my code works fine when i share a image via whatsapp....but for viber , google hangout im getting "can't find photo" error. this is my code :
int ImageResourse=imageAdapter.mThumbIds[position];
Uri path = Uri.parse("android.resource://dragonflymobile.stickers.lifestickers/" + ImageResourse);
Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND, path);
((Activity)getActivity()).setResult(Activity.RESULT_OK, shareIntent); //set the file/intent as result
((Activity)getActivity()).finish(); //close your application and get back to the requesting application like GMail and WhatsApp
Few, if any, apps support the
android.resource
scheme.You are welcome to share things using the
content
scheme, such as viaFileProvider
, as more apps will support that.i found a solution to this without using FileProvider or android.resource scheme . thnx CommonsWare for explaining the situation with android.resource scheme