2
A
回答
2
Intent intentIN = getPackageManager().getLaunchIntentForPackage("PACKAGE NAME");
if (intentIN != null) {
Intent shareIntentIN = new Intent();
shareIntentIN.setAction(Intent.ACTION_SEND);
shareIntentIN.setPackage("com.instagram.android");
try {
shareIntentIN.putExtra(Intent.EXTRA_STREAM, Uri.parse(MediaStore.Images.Media.insertImage(getContentResolver(), "", "I am Happy", "Share happy !")));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
shareIntentIN.setType("image/jpeg");
startActivity(shareIntentIN);
} else {
// bring user to the market to download the app.
// or let them choose an app?
intentIN = new Intent(Intent.ACTION_VIEW);
intentIN.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intentIN.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.instagram.android&hl=en"));
startActivity(intentIN);
}
请尝试this.change包名称,按您的需要。
0
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT, mUrl);
shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, mTitle);
startActivity(Intent.createChooser(shareIntent, "Share XXX"));
相关问题
- 1. 如何获取列表中的所有共享应用程序(安装在设备上)?
- 2. 如何获取已安装应用程序的设备的deviceid?
- 3. 获取安装在设备上的应用程序信息
- 4. 获取Android设备上安装的应用程序列表 - C#
- 5. 获取安装我的应用程序的所有设备的UDID的方法
- 6. 如何共享信息,而不“谷歌加”应用程序安装在设备
- 7. 如何获取用户安装的所有应用程序?
- 8. 如何获取设备上安装的Android应用程序的包名
- 9. 如何获取所有安装的应用程序列表?
- 10. 如何获取设备上安装的其他特定应用程序的所有<使用权限>(Android)?
- 11. 网络共享上的安装程序
- 12. android-获取应用程序安装在设备中的异常
- 13. 如何在iOS上的Swift中获取共享应用程序?
- 14. 如何确定在Android设备上安装的应用程序?
- 15. 如何在我的应用程序中使用iCloud keychain在不同设备上跨安装共享值?
- 16. 如何获取安装在Android手机上的所有应用程序
- 17. 安装在没有GPS的设备上的FINE_LOCATION应用程序?
- 18. 在没有iTunes的设备上安装应用程序
- 19. 如何在ubuntu Touch设备上安装应用程序
- 20. 如何在iPhone设备上安装rhomobile应用程序
- 21. 如何在Android设备上静默安装应用程序?
- 22. 在iOS设备上的应用程序之间共享文件
- 23. 如何共享应用程序设置
- 24. 从网络共享安装ClickOnce应用程序安装失败
- 25. 使用Category.LAUNCHER获取所有已安装的应用程序
- 26. 获取所有安装的应用程序的图标列表
- 27. 获取所有安装的应用程序的列表
- 28. 钛:检查设备上安装的应用程序(安卓)
- 29. Android应用程序没有安装在设备上?
- 30. 激活设备应用程序安装