When I launch activity from the widget, I want the back button to go to the main screen, but instead it goes to the main action of the application. After the conversation, I found that if I somehow close the main activity of the application, this problem does not occur. Itβs strange.
I found a solution here that said finish () is being called; in my main activity onPause (). Obviously, this is the wrong decision, for example. reorienting the screen calls onPause (), so will activity will burn whenever the phone is rotated.
Here's how I get started:
@Override public void onReceive(Context context, Intent intent) { [...]
You can see the rest of the code at http://code.google.com/p/emergencybutton/source/browse
edit: I tried to start the action in a different way, but still it does not work correctly:
Intent myIntent = new Intent(); myIntent.setClassName("com.emergency.button", "com.emergency.button.EmergencyActivity");
source share