I have compileSdkVersion and targetSdkVersion 23 and testing on Samsung galaxy s3. But whenever i open any third party app (explicit intent) like camera/gallery app or share intent (gmail, email) or dialer app and comeback to my app by pressing back button or (in case of camera/gallery app by selecting picture). App restarts from MainAcitivty (maybe it is getting crashed but it does not show any exception in logcat). Here is how i open intents:
Call/Dial:
Intent callIntent = new Intent(Intent.ACTION_DIAL);
callIntent.setData(Uri.parse("tel:" + phone));
context.startActivity(callIntent);
Gallery:
Intent intent = new Intent(Intent.ACTION_PICK,
MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(intent, GALLERY_PIC_REQUEST);
Share:
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_SUBJECT, subject);
context.startActivity(Intent.createChooser(intent, dialogHeaderText));
This issue is only coming in Samsung s3. I have tested all above functionalities on Google nexus 5, Huawei Honor 4C and Samsung galaxy s5 it is working fine. Any help?