草庐IT

audio_intent

全部标签

android - 选择图片Intent导致空指针异常

publicvoiduploadpicture(Viewview){Intentintent=newIntent();intent.setType("image/*");intent.setAction(Intent.ACTION_GET_CONTENT);startActivityForResult(Intent.createChooser(intent,"SelectPicture"),SELECT_PICTURE);}publicvoidonActivityResult(intrequestCode,intresultCode,Intentdata){if(resultCode=

android - 如何接收 Intent。 ACTION_PACKAGE_ADDED Intent 。应用小部件中的 ACTION_PACKAGE_REMOVED?

如何在appwidget中接收Intent.ACTION_PACKAGE_ADDED和Intent.ACTION_PACKAGE_REMOVED?我尝试在list中添加intent-filter:我也试过在代码中注册:@OverridepublicvoidonEnabled(Contextcontext){registerReceiver(context);Utils.log(TAG,"RegisterPACKAGE_ADDEDPACKAGE_REMOVED");}privatevoidregisterReceiver(Contextcontext){IntentFilterfilte

java - 连接更改接收器在 android 中获得错误 Intent

我正在尝试为我的应用添加一些连接状态感知。使用此处的示例和谷歌的文档,我想出了一个接收器,它可以在连接状态更改时正确显示警报,但也会在创建Activity时意外地显示警报。ConnectStatusReceiver:packagecom.zivtaller.placefinder.receivers;importandroid.content.BroadcastReceiver;importandroid.content.Context;importandroid.content.Intent;importandroid.net.ConnectivityManager;importan

android - 没有默认启动的 Intent ACTION_SEND

我正在尝试通过我的应用在Intent中使用ACTION_SEND来分享文本。但是,如果您选择默认使用一个应用程序,它将与同一个应用程序共享,而不会每次都询问。有人可以帮我吗?如果可行,它应该能够像这段代码那样通过邮件、facebook、twitter、whatsapp进行分享。谢谢。IntenttextShareIntent=newIntent(Intent.ACTION_SEND);textShareIntent.putExtra(Intent.EXTRA_TEXT,"Texttoshare,URL");textShareIntent.setType("text/plain");st

android - 广播接收器和未决 Intent : Show a toast

以下是必须触发BroadCastReceiver的警报代码:IntentintentWithData=newIntent(context,TokenActivity.class);intentWithData.putExtra(Constants.ID,id);intentWithData.putExtra(Constants.POSITION,finalI);PendingIntentpendingIntent=PendingIntent.getBroadcast(context,007,intentWithData,0);AlarmManageralarmManager=(Alar

android - Android 7.1 static app-shortcuts creator 可以在 intent 中添加额外内容吗?

这是一个简短的问题:AndroidNougat7.1为启动器提供了一项新功能,可通过显示菜单来创建应用程序快捷方式以供选择:https://developer.android.com/about/versions/nougat/android-7.1.htmlhttps://developer.android.com/guide/topics/ui/shortcuts.html据我所知,如果您使用动态快捷方式,您可以将任何您想要的东西放入其中,但是静态快捷方式(那​​些通过XML预先确定的快捷方式)可以有额外的东西吗?含义:例如,我可以在快捷方式的Intentbundle中放置一个字符

android - 如何正确创建像 Tez 一样的 Intent 引用?

在我的应用程序中,我必须添加一个Intent来分享我的应用程序。我查看了Tez,它共享应用程序图标以及包含超链接的文本。如何做到这一点? 最佳答案 你可以试试这个..Uriuri=Uri.fromFile(imageFile);Intentintent1=newIntent();intent1.setAction(Intent.ACTION_SEND);intent1.setType("image/*");intent1.putExtra(android.content.Intent.EXTRA_SUBJECT,"AppName")

java - 媒体播放器的 Intent 过滤器(Youtube 视频播放)

我开发了自己的媒体播放器,我希望当我想从Youtube观看视频时,它应该从我的应用程序中打开。至少,View上应该有一个媒体应用程序列表,我应该能够从列表中选择我的应用程序。我对Intent过滤器了解不多。我如何在我的list文件中提供这个?我正在努力为本地文件进行训练,但我也还没能做到。我真的需要你的帮助:/ 最佳答案 如果您查看官方youtube应用程序使用的intent过滤器,您会看到:要获取视频ID,您可以解析从中获取的字符串:Uriuri=this.getIntent().getData();如您所见,youtu.be没有

PDF 发送 Intent 上的 Android SecurityException

我在数据类型为application/pdf的ACTION_SENDIntent期间遇到以下异常:java.lang.SecurityException:PermissionDenial:startingIntent{act=android.intent.action.SENDtyp=application/pdfflg=0x3080000cmp=com.adobe.reader/.ARSendForSignature(hasextras)}这会弹出一个对话框,用于选择接收PDF所需的应用程序。我相信当用户从列表中选择Adob​​eReader时会抛出SecurityException

Android 浏览器 Intent - 使用 GPS 坐标打开导航应用程序

我希望向网页添加一个简单的一键式解决方案,以便Android用户可以单击“立即导航”链接,该链接将自动打开一个导航应用程序(例如谷歌地图),以便他们可以轻松导航到那个目的地。我已经在Android浏览器中的谷歌搜索中看到了这个实现,例如当您搜索公司名称时,但我自己似乎无法弄清楚,并且与这种基于浏览器的API形式中使用的技术术语混淆使我走到了死胡同。任何人都可以告诉我我应该寻找什么,你指出我可以找到答案的地方吗?任何帮助将不胜感激。 最佳答案 您只需将链接指向GooglemapURL(即“http://maps.google.com/