草庐IT

schema_uri

全部标签

java - URI 和 Uri 类有什么区别

我很困惑,如何使用Uri因为我在Intent的android开发中使用它ActiondialIntentintent=newIntent(Intent.ACTION_DIAL,Uri.parse("tel:555-2368"));我想做什么:我想创建一个文件,我想在其中放入2个电话号码。然后,我想对这个文件使用toUri()方法,并想把那个Uri放在Intent中,然后我想看看Intent会发生什么。 最佳答案 根据AndroidAPIdocs你可以创建一个Uri文件:publicstaticUrifromFile(文件文件)

android - ContentResolver notifyChange 方法是否也通知了 Uri 的详细信息?

在应用数据期间,我使用带有Uri的notifyChange。假设我通知content://com.package.my/items。我还详细说明了显示来自content://com.package.my/items/1的数据的Activity。是否通知“一般”Uri也会通知“详细”Uri? 最佳答案 notifyChange方法发送详细URI的通知。但是,如果您在ContentResolver.registerContentObserver(Uriuri,booleannotifyForDescendents,ContentObse

android - 如何使用 FLAG_GRANT_READ_URI_PERMISSION 授予对自定义内容提供程序的临时访问权限

我正在尝试从另一个应用程序(应用程序B)查询自定义内容提供程序(应用程序A)。当内容提供者没有权限保护时,我可以这样做。具体来说,我在应用程序A上构建了自定义内容提供程序,并将包含URI的Intent发送到应用程序B。这是应用程序A中的Intent发送部分。classInsertOnClickListenerimplementsOnClickListener{publicvoidonClick(Viewv){ContentValuesvalues=newContentValues();values.put(DataBaseConfiguation.TableConfiguation.U

带有自定义 URI 的 Android 深度链接

我在list中定义了以下内容:......我已经这样定义了我的onCreate():@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);Intentintent=getIntent();Uridata=intent.getData();if(data!=null){Log.d("URI",data.toString());}}这与Android文档一致:AndroidDeepLinking那么问题是:如何测试URI深层链接?根据文档我运行类似adbshel

android - 无法在 root 设备 : INSTALL_FAILED_INVALID_URI 上安装包

这是我尝试在我的设备上安装我的应用程序时看到的(我使用的是AndroidStudio0.8.2):Waitingfordevice.Targetdevice:samsung-gt_s7500-cf994b04Uploadingfilelocalpath:C:\Users\Administrator\AndroidStudioProjects\Testaqua\app\build\outputs\apk\app-debug.apkremotepath:/data/local/tmp/com.example.administrator.testaquaInstallingcom.examp

android - 从 URI 获取文件路径

我有图像文件的Uri。我使用此代码从Uri获取文件路径:publicStringgetRealPathFromURI(UricontentUri){Cursorcursor=null;try{String[]proj={MediaStore.Images.Media.DATA};cursor=mContext.getContentResolver().query(contentUri,proj,null,null,null);intcolumn_index=cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);cursor

android - 为什么 MediaStore.Audio.Albums.EXTERNAL_CONTENT_URI 不提供准确的 "Album Artist"?

我正在使用androidMediaStore。我可以获得设备上的音乐列表,以及与每个媒体项目相关的所有详细信息(标题、艺术家、持续时间等)我希望能够显示专辑列表,以及他们的专辑艺术家。需要明确的是,每首轨道都有一位艺术家,例如“NoFX”,但如果该轨道出现在合辑CD上,例如Punk-O-Rama,则艺术家是“NoFX”,但专辑艺术家可能类似于“各种艺术家。”我在这里复习了这个问题:Android-GettingAlbumArtistfromCursor我正在尝试使用MediaStore.Audio.Albums.EXTERNAL_CONTENT_URI和MediaStore.Audio

android - 无法从 whatsapp 共享 URI 获取图像路径

Uri=content://com.whatsapp.provider.media/item/118727我无法从此URI获取实际路径 最佳答案 在Documentation之后,我通过以下方式接收图像Intent:voidonCreate(BundlesavedInstanceState){...//Getintent,actionandMIMEtypeIntentintent=getIntent();Stringaction=intent.getAction();Stringtype=intent.getType();if(In

android - 将 URI 与 <data> 匹配,例如 AndroidManifest 中的 http ://example. com/something

我正在为苦苦挣扎AndroidManifest.xml中的元素文件以使我的URI匹配工作。我想匹配以下URI:http://example.com/somethinghttp://example.com/foohttp://example.com/foo/但不是http://example.comhttp://example.com/http://example.com/something/else我主要是用它来工作但它仍然匹配http://example.com/something/else.我怎样才能排除这些? 最佳答案 不幸的

android - 从 ACTION_PICK 共享文件 uri

我正在尝试制作一个应用程序,要求用户选择一个图像文件,然后通过Intent将其发送到另一个应用程序(在这种情况下是Whatsapp,但这应该适用于其他应用程序)我这样做是为了请求文件:Intentintent=newIntent(Intent.ACTION_GET_CONTENT);intent.setType("image/*");intent.addCategory(Intent.CATEGORY_OPENABLE);try{startActivityForResult(Intent.createChooser(intent,"SelectaFiletoUpload"),FILE_