My app normally works just fine, until I face a strange problem on specific device. There are 2 activities in App. After I start ActivityB inside of ActivityA, ActivityA starts
Have you tried changing the launchmode
in the Android Manifest? Try adding this to your Activity declaration:
android:launchMode="singleTask"
Next, try using startActivityForResult
, instead of startActivity
. This will force Activity A to call its onActivityResult(int, int, Intent)
method when Activity B finishes - which may skip this (buggy) call to onCreate
. Then, in Activity A, implement the method to do something (such as printing a debug statement):
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
Log.i("Test", "Did this work???");
//TODO send notification to your server to verify this works?
}