Home Using share intent in Instagram. How to know is user actually shared or cancelled sharing activity?
Reply: 0

Using share intent in Instagram. How to know is user actually shared or cancelled sharing activity?

user851
1#
user851 Published in May 27, 2018, 3:38 am

Below is code;

 Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
 shareIntent.setType("image/*");
 shareIntent.putExtra(Intent.EXTRA_STREAM,  Uri.parse("file://" + finalFile.getAbsolutePath()));
 shareIntent.setPackage("com.instagram.android");
 startActivityForResult(Intent.createChooser(shareIntent, "Share your Photo"),INSTA);

And below onActivityResult is not work;

if (requestCode==INSTA)
    {
        if (resultCode == Activity.RESULT_OK) {
            // Here you do what you have to do.
            Toast.makeText(getApplicationContext(),"share successful...",Toast.LENGTH_LONG).show();
        }else 
        {
            Toast.makeText(getApplicationContext(),"share unsuccessful...",Toast.LENGTH_LONG).show();
        }

    }
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.30058 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO