I have already tried this code, but i didn't saw photo shared in my account.
File file = new File("sdcard/1346249742258.jpg");
String photoUri = null;
photoUri = file.getAbsolutePath();
Intent shareIntent = ShareCompat.IntentBuilder.from(this)
.setText("Sharing an image on Google!").setType("image/jpeg")
.setStream(Uri.parse(photoUri)).getIntent()
.setPackage("com.google.android.apps.plus");
startActivity(shareIntent);
You can share image using below api's. For detailed steps check tutorial
http://androidsrc.net/integrating-google-plus-sign-in-into-your-android-application/
The Google+ app only supports content:// URIs. You will need to use the
MediaStore
API for this purpose.Integrate ForGooglePlus Activity in your code and put URL(imageUrl) ,Description(description text) and contentUrl(URL) for the same. Note : bellow code also worked in my app.
HEy Deepika you are getting file nor found exception because that google plus app is not present on the device the way you have coded is just to start the native app from the device
it will work only if the native ap is actully present
otherway is to have google plus sdk which is small jar file with that you can share image
https://developers.google.com/+/mobile/android/
Don't use absolute path.
OnActivityResult() use this after capturing image from camera.
This is working for me.
I am also posting image on google plus through android using intent i am taking screen shot of device and posting it on google plus, i used your code i am getting exception FileNotFoundException() and as you mention to use absolute path i got error, The method getAbsolutePath() is undefined for the type String my code is given below please suggest me correction in code
Thank you and regards Nitin