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

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

    خبرنامه

    عضویت

    نام کاربري :
    رمز عبور :