将数据发送到指定的应用程序的Android

问题描述:

我读到关于使用ACTION_SEND摆脱这个link将数据发送到指定的应用程序的Android

注册文件列表的应用程序我使用代码:

Intent sendIntent = new Intent(); 
sendIntent.setAction(Intent.ACTION_SEND); 
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send."); 
sendIntent.setType("text/plain"); 
startActivity(sendIntent); 

,但我想发送到指定的应用程序,而不列表。怎么做?

+0

这应该解决您的问题http://stackoverflow.com/questions/8308666/how-to-force-share-intent-to-open-a-specific-app – Neil 2013-03-19 12:22:06

+2

“我想发送到指定的应用程序没有列表“ - 你想要什么并不重要。 *用户*想要的是重要的。请允许用户* *选择其中*用户*股*用户*的数据。 – CommonsWare 2013-03-19 12:30:43

指定意向的东西,只有指定的活动将处理,例如,自定义MIME类型或实际的目标类名称中使用intent.setClassName()