0
@Override 
public void onActivityResult(int requestCode, int resultCode, Intent data) 
{  
     super.onActivityResult(requestCode, resultCode, data);
     if(requestCode==392 &&resultCode==RESULT_OK)
     { 
          System.out.println("Google+"); 
     } 
}

Intent shareIntent = ShareCompat.IntentBuilder.from(getActivity())
            .setText(". http://www.http://stackoverflow.com/")
            .setType("text/plain")
            .getIntent()
            .setPackage("com.google.android.apps.plus");

            startActivityForResult(shareIntent, 392);

I want to check if it is posted or not, How to check if user posted successfully or cancelled the Sharing.

2
  • 2
    I guess you could override onActivityResult() and listen for RESULT_OK and RESULT_CANCELED.
    – Andy Res
    May 28, 2014 at 10:57
  • 1
    @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if(requestCode==392 &&resultCode==RESULT_OK){ System.out.println("Google+"); } } May 28, 2014 at 11:16

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.