Stack Overflow archive
1 score

I'm starting an activity from a broadcast receiver, but why is my other activity also starting?

score
1
question views
3.9K
license
CC BY-SA 3.0

From looking at your code and logs I think your problem is calling onBackPressed in your fragment.

java
11-27 21:56:46.206  29370-29370/com.example.videoalarmt I/AlarmFragment{41edaa40 #0 id=0x7f0a0024}﹕ onPause

Your AlarmFragment.onPause should not be calling getActivity().onBackPressed(). This is most likely what is causing your activity to close. Simply remove that line in AlarmFragment.onPause and I think your issue will be resolved.

Originally posted on Stack Overflow. Public user contributions are licensed under Creative Commons Attribution-ShareAlike.