草庐IT

EXTERNAL_CONTENT_URI

全部标签

android - 编辑文本错误 : content duplicates after pressing a restricted character

我有一个包含受限字符的EditText。我只允许数字作为GalaxyS4上出现了一个奇怪的东西。它没有出现HTCDesireHD、HTCDesireX和ZTEBlade。我输入dddsss我输入一个瑞典字符,例如å。它没有出现,因为它不是允许的字符,所以内容仍然是dddsss我输入一个字符,例如uEditText的内容变为dddsssdddsssu我输入另一个字符,例如t内容变为dddsssdddsssudddsssut有时我按下退格键也会发生这种情况,所以这一定是按钮按下的问题。我添加了android:inputType="textNoSuggestions"但它没有帮助。有人遇到过

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

android - 不使用 WRITE_EXTERNAL_STORAGE 共享图像?

有没有一种方法可以使用Intent.ACTION_SEND来共享屏幕截图而不需要android.permission.WRITE_EXTERNAL_STORAGE?分享部分如下:IntentshareIntent=newIntent(Intent.ACTION_SEND);shareIntent.setType("image/jpeg");shareIntent.putExtra(Intent.EXTRA_STREAM,uri);IntentchooserIntent=Intent.createChooser(shareIntent,shareTitle);startActivity(

android - KitKat 仍然需要 WRITE_EXTERNAL_STORAGE?

如documentation中所述,从API级别19开始,WRITE_EXTERNAL_STORAGE权限不应该是必需的。因此,我已将其写入list:但是,当我运行使用GoogleMapsV2并因此需要访问外部存储的应用程序时,我得到了一个SecurityException:java.lang.SecurityException:TheMapsAPIrequirestheadditionalfollowingpermissionstobesetintheAndroidManifest.xmltoensureacorrectbehavior:我正在运行该应用程序的手机是KitKat(4.

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 - 在 Android 中处理未知的 URI 方案(比特币示例)

我想在Android应用程序的PreferenceScreen中集成一个“通过比特币捐赠”按钮。Android上有一些比特币客户端在运行,比特币wiki定义了一个URIscheme应该用于BTC支付。我试过下面的代码findPreference(getString(R.string.preference_donateBitcoin)).setOnPreferenceClickListener(newOnPreferenceClickListener(){@OverridepublicbooleanonPreferenceClick(Preferencepreference){Strin

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

Solidity 关键词说明(payable transfer event modifier msg external public view pure memory)

一、payable在Solidity中,payable是一个关键字,用于表示函数可以接收以太币(ether)的转账。如果一个函数被声明为payable,那么它就可以接收以太币的转账,而不仅仅是使用以太币作为参数进行函数调用。例如,下面是一个声明了payable关键字的函数:functionbuyToken()publicpayable{//程序逻辑...}在上面的代码中,函数buyToken()会接收以太币的转账,并且转账的数量会作为函数的参数msg.value被传递进来。如果这个函数没有被声明为payable,那么在进行转账时就会出现错误。需要注意的是,在接收以太币的函数中,你需要确保对于接