草庐IT

tab-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 SDK 工具 21 : Help in Compile with tab

最近我更新了SDK,出现了这个新的“编译方式”选项。这是什么意思? 最佳答案 意思是尽管有targetSdk,还是会使用“compilewithSDK”版本。这有助于针对更高版本的SDK并避免意外使用更新的API。或者,换句话说,您希望以API17为目标,但不费吹灰之力就与API8保持兼容。因此,您将目标设置为API17,但编译为API8。现在,如果您出于任何原因编写代码使用API9或更高版本中引入的任何内容,它将无法编译。以前应用程序是使用API版本设置为目标sdk构建的编辑仔细一看,我认为这是坏的。它基本上既不保存在projec

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 - 之前调用Fragment的onStart()来显示Viewpager、navigation_mode_tabs

我使用了一个ViewPager和一个带有NavigationMode的ActionBar:“NAVIGATION_MODE_TABS”我放了3个fragment:Fragment0(左标签),Fragment1(中间标签),Fragment2(右标签)首先,出现Fragment0并为Fragment0和Fragment1调用方法“onCreateView”和“onStart”如果我水平滑动到“中间标签”(Fragment1),Fragment2(右侧标签)的“onCreateView”和“onStart”方法被调用...所以,我想知道这是否正常?因为我想在Fragment2出现之前调用

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