I figured this out. I was doing this:
this.mainIntent = PendingIntent.getActivity(this, 0, new Intent
(this, MyActivity.class), 0);
which created a new intent that was used to create the the
notification. Instead I do this:
this.mainIntent = PendingIntent.getActivity(this, 0,
Thanks Dianne - I appreciate the response.
Instead of prompting for exit, I decided to capture the back button
keypress, then send the app to the background like this:
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK)
{
Sorry, one more new problem that is odd..
Using this method, my app is running in the background. If I launch
the app again from the home screen using the application icon, it
correctly switches to my running app. However, if the user pulls down
the notification list and clicks my notification
You probably shouldn't count pressing the back button as closing the app as
you describe here. If there is some ongoing work that it does in the
background, you should have a separate UI for the user to start and stop
that work, and the ongoing notification should take the user to the
4 matches
Mail list logo