How to get all installed app in share intent dailog?

ساخت وبلاگ

Vote count: 0

I am trying to share image using share intent to already installed app, but when i try to share it shows only whtsapp application instead of all the installed apps.can any one help me to get all the installed apps to share my image.

 View content = view.findViewById(R.id.imageView3); content.setDrawingCacheEnabled(true); Bitmap bitmap = content.getDrawingCache(); File root = Environment.getExternalStorageDirectory(); File cachePath = new File(root.getAbsolutePath() + "/DCIM/Camera/image.jpg"); try { cachePath.createNewFile(); FileOutputStream ostream = new FileOutputStream(cachePath); bitmap.compress(Bitmap.CompressFormat.JPEG, 100, ostream); ostream.close(); } catch (Exception e) { e.printStackTrace(); } final Intent emailIntent = new Intent(Intent.ACTION_SEND); emailIntent.setType("text/plain"); emailIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.app_name)); emailIntent.putExtra(Intent.EXTRA_TEXT, "Text to share"); emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(cachePath)); //............Pass Image URI here......... emailIntent.setType("image/*"); emailIntent.setPackage("com.whatsapp"); startActivity(Intent.createChooser(emailIntent, "Share..."));
asked 58 secs ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 379 تاريخ : دوشنبه 1 خرداد 1396 ساعت: 13:03