草庐IT

expiration_intent

全部标签

Android list 合并 : removing LAUNCHER intent-filter doesn't take effect

在我的android应用程序中,我使用了一个库项目,并且我使用了其中的一个Activity。但是在图书馆项目中,该Activity具有MAIN操作和LAUNCHER类别intent-filter。所以我将该Activity添加到我的list中并删除了intent-filter。list似乎已正确合并到build/intermediates/manifests/full/debug/AndroidManifest.xml中,并且Activity看起来符合预期(没有intent-filter):但是,当我在模拟器中从AndroidStudio启动应用程序时,将启动库的LoggerActiv

android - Android 中的 Intent 与 Content Provider

我是android应用程序开发的新手,在研究基本的android组件时,我对intents和contentprovider感到困惑,因为两者都被用来将数据从一个应用程序/组件发送到另一个应用程序/组件。如果有意向,我们可以使用bundle或extras发送数据,那么我们为什么要使用内容提供者。有人可以用一个例子向我解释一下吗?我们也可以仅使用内容提供者访问android中的数据库,这是我们使用内容提供者的唯一原因吗? 最佳答案 botharebeingusedtosenddatafromoneapplication/componen

android - 如何从 ACTION_SEND Intent 中排除特定应用程序?

我已使用以下代码从我的应用选择器中排除facebook应用:ListtargetedShareIntents=newArrayList();Intentintent=newIntent(android.content.Intent.ACTION_SEND);intent.setType("image/*");ListresInfo=getActivity().getPackageManager().queryIntentActivities(intent,0);if(!resInfo.isEmpty()){for(ResolveInforesolveInfo:resInfo){Stri

java - Android 共享 Intent 选择器 - 与 Facebook/Twitter 社交媒体等共享文本

如果我只发送文本,ShareIntent选择器不会提供Facebook/Twitter作为选项。只有Gmail、Skype和Evernote是选项。这是我的代码IntentshareIntent=newIntent(Intent.ACTION_SEND);shareIntent.setType("plain/text");shareIntent.putExtra(Intent.EXTRA_TEXT,text)startActivity(Intent.createChooser(shareIntent,"Shareusing"));我尝试了setType()的不同组合,包括“text/*

android - Intent : remove Always/Only once buttons

我是Android开发的新手。打开Intent.ACTION_GET_CONTENT时是否可以删除两个按钮(始终/仅一次)?这是我当前的代码。Intentintent=newIntent(Intent.ACTION_GET_CONTENT);intent.setType("image/*");startActivityForResult(intent,PICK); 最佳答案 我找到了实现这个的方法:Intentintent=newIntent(Intent.ACTION_GET_CONTENT);intent.setType("im

使用 Intent 的 android.content.ActivityNotFoundException

我正在编写一个应用程序,我试图在其中发送一封包含一些数据的电子邮件,但每当我点击提交按钮发送电子邮件时,得到:不幸的是应用程序已停止错误:android.content.ActivityNotFoundException:NoActivityfoundtohandleIntent{act=android.intent.action.SENDtyp=text/plain(hasextras)}代码:IntentemailIntent=newIntent(android.content.Intent.ACTION_SEND);emailIntent.setType("text/plain"

android - Intent 和 Parcelable 对象 Android

为什么我需要打包我的对象,即使我只需要将它发送到同一任务的另一个线程?实际上,我需要打开一个甚至会在同一线程(主线程)上运行的Activity。换句话说,为什么Google不提供采用通用对象广告参数而不是bundle的startActivity版本来让我启动一个Activity,以防我知道它在同一个进程中或(大多数时候)即使是同一个线程(主要线程)? 最佳答案 您不需要使用Parcelable将对象从一个Activity传递到另一个Activity。您可以只将对象的引用存储在静态成员变量中,如下所示:publicclassGloba

android - 仅与蓝牙选项共享 Intent

我正在尝试使用我的应用程序通过蓝牙发送文件。我已经将mime类型更改为随机类型,如asdxasd/asdxa该文件有一个我需要使用的扩展名,即.sso当我使用共享Intent时,它只出现蓝牙和gmail选项,但我不能从列表中删除gmail选项吗?提前致谢!我正在使用此代码发送它,目的是:file=newFileSystem(this).saveTemp();IntentsharingIntent=newIntent(Intent.ACTION_SEND);UriscreenshotUri=Uri.fromFile(file);sharingIntent.setType("test/on

java - 如何使用 Intent 打开 "Add a Google Account" Activity ?

我的问题是如何在不使用需要以下权限的AccountManager的情况下使用Intent打开“添加Google帐户”Activity:我的意思是找到解决以下问题的方法:AccountManageraccountMgr=AccountManager.get(context);accountMgr.addAccount("com.google","ah",null,newBundle(),context,null,null);我将为所有寻求解决此问题的人提供解决方案。 最佳答案 通过提供EXTRA_ACCOUNT_TYPES来回答上述问

java - 从 Intent.createChooser 获取选择的应用程序

我正在trycatchIntent.createChooser的结果,以了解用户选择了哪个应用进行共享。我知道有很多帖子与此相关:Howtoknowwhichapplicationtheuserchosewhenusinganintentchooser?https://stackoverflow.com/questions/6137592/how-to-know-the-action-choosed-in-a-intent-createchooser?rq=1HowtogettheuserselectionfromstartActivityForResult(Intent.create