Question

I have an activity that sends a BC and waits 5 seconds for the response using AlarmManager. Once i get the broadcast i: 1. remove the FragmentDialog using mDialog.dismiss(); 2. start a new activity using getActivity().startActivity(myIntent);

I'm inside a Fragment (using TabFragment from the support library and MyTabActivity which i created). The thing is i constantly getting balck screen and ANR, if i remove the line startActivity() I'm not getting the ANR, the fragment does gets dismissed, but my activity doesn't show, i get the black screen and if i press it, ANR. What i thought about is that the fragment manager started out working on the activity and then i started a new one that fucks up android, since i'm basing myself on fragment i really don't know how to get out of this mess, thought of using handler in the activity to post my activity start in 300 millis, this is a very very ugly solution. Any nice ideas ?

Was it helpful?

Solution

the problem seems to be that i unbding a service twice in onStop of the activity due to the fact that once i call unbind ServiceDisconnected is NOT called and changes the state of my activity to unbonded (state i follow). since onStop is never eding the original activity gets the UIthrehad and make the whole app stuck...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top