草庐IT

tt_content

全部标签

java - 尝试在空对象引用上调用虚拟方法 'android.os.Looper android.content.Context.getMainLooper()'

这个问题在这里已经有了答案:WhatisaNullPointerException,andhowdoIfixit?(12个答案)关闭5年前。每当我尝试在我的手机或模拟器上打开该应用程序时,我的Logcat中都会出现此错误。为了让您大致了解我目前正在做的项目,它是一个记录连接到手机接入点的设备数据的系统,可以通过屏幕上的按钮打开和关闭。我想归功于:Android2.3wifihotspotAPI和https://www.whitebyte.info/android/android-wifi-hotspot-manager-classLogcat文件的图像是:https://i.gyazo

java.lang.NoClassDefFoundError : Failed resolution of: Landroid/support/v4/content/LocalBroadcastManager only on Build APK 错误

我在这里和谷歌上搜索了很多,但没有找到解决我问题的答案。当我从即时运行运行我的应用程序时,它运行良好。当我生成我的发布APK时,它不会打开并仅在Lollipop版本(5.0和5.1,在6.0>上工作正常)上显示此错误:08-1511:31:47.6892605-2605/br.com.turbi.turbiE/AndroidRuntime:FATALEXCEPTION:mainProcess:br.com.turbi.turbi,PID:2605java.lang.NoClassDefFoundError:Failedresolutionof:Landroid/support/v4/c

Android:通过 content://URI 从第三方应用程序(例如 WhatsApp)获取图像位图

我正在尝试从第三方应用程序(例如WhatsApp)获取图像到我的应用程序(正在Marshmallow上测试)。当我从WhatsApp“分享图片”并与我的应用分享时,我得到的URI是这样的:content://com.whatsapp.provider.media/item/61025但是在我的应用程序中,当我调用getContentResolver().openInputStream(uri)时或getContentResolver().openFileDescriptor(uri,"r")使用上述URI,它会异常崩溃:java.lang.SecurityException:Permi

不兼容类型:android.content.dialoginterface.onclicklistener无法转换为android.view.view.view.onclicklistener

我无法使此按钮起作用:publicvoidsetConfirmListenner(OnClickListenerlistener){((Button)this.contentView.findViewById(R.id.confirmButton)).setOnClickListener(listener);}错误:(296,85)错误:不兼容类型:android.content.dialoginterface.onclicklistener不能转换为android.view.view.view.onclicklistener看答案从字面上看,您必须阅读错误所说的内容:View.OnClick

android - ACTION_GET_CONTENT : How to get file-ending when searching for multiple file types?

我正在使用Intent让用户选择一个文件,在用户完成后我想知道所选文件的文件类型。Intent:Intentintent=newIntent(Intent.ACTION_GET_CONTENT);intent.setType("*/*");在我的onActivityResult中,我想通过intent.getData()及其所有“子方法”(getScheme()、getLastPathSegment()等)从Intent中提取路径。但是,我只获得所选文件的Uri。Uris的示例:Uri:content://media/external/audio/media/15185//Thisis

android - W/PicturePileLayerContent:警告 : painting PicturePile without content

我在logcat中收到此警告,我在网上搜索但没有找到原因或我应该如何处理它?这说明什么?这是logcat,logcat中没有其他异常02-2315:17:52.19029817-30304/com.astrolabe.iremoteW/PicturePileLayerContent﹕Warning:paintingPicturePilewithoutcontent!02-2315:17:52.19029817-30304/com.astrolabe.iremoteW/PicturePileLayerContent﹕Warning:paintingPicturePilewithoutco

java - ProcessException : ExecException: Process 'command ' /Library/Java/JavaVirtualMachines/jdk1. 8.0_31.jdk/Content/Home/bin/java

我遇到异常:Error:Executionfailedfortask':app:dexDebug'.>com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:Process'command'/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java''finishedwithnon-zeroexitvalue2在我将GooglePlay服务更新到7.5.0之后:compile'c

android - RecyclerView 高度 wrap_content 计算不正确

我希望我的RecyclerView为wrap_content。我不希望RecyclerView内有任何滚动,它应该适应内部child的高度。我不希望我的父ScrollView滚动我的Activity内容。填充RecyclerView:myAdapter=newMyAdapter();layoutManager=newLinearLayoutManager(this);mRecyclerView.setLayoutManager(newLinearLayoutManager(this));mRecyclerView.setAdapter(myAdapter);我使用RecyclerVie

android - 零星的 IllegalArgumentException : Unknown URL content://

很少得到:FatalException:java.lang.IllegalArgumentException:UnknownURLcontent://com.example.provider/infoatandroid.content.ContentResolver.insert(ContentResolver.java:1252)FatalException:java.lang.IllegalArgumentException:Unknownauthoritycom.example.provideratandroid.content.ContentResolver.applyBatc

android - Retrofit2 使用 RxJava 的 Observable 概念处理 HTTP 204(No Content response)情况

我有一个网络服务,它返回一个主题的用户列表,如果该主题没有任何用户,它只返回HTTP代码204(无内容)。这是我对该服务的retrofit2调用(在Kotlin中)@GET("/user/{topic}")fungetAllUserFor(@Path(value="topic",encoded=true)topic:String):Observable>我的执行是:fungetAllUsers(topic:String,onSuccess:Consumer>,onFail:Consumer){valapi=NetworkLayer.getUserApi()api.getAllUserF