我想要共享文本和图像,我找到应用程序包明智的搜索,然后共享应用程序明智的共享功能。
请帮忙。
注意:我只想分享带有链接的文本。
谢谢
最佳答案
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);
}
请尝试这个。根据您的需要更改包名称。
关于android - 如何获取设备上安装的所有共享应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24906527/