as the title states, how do I return to an activity that has been started but not by calling finish(). I'm primarily concerned about this because I don't know how to tell a Notification to return to the original activity that created it when a user pulls down their notification bar and clicks on the notification. The tutorial on how to create a notification only explains how to la开发者_JS百科unch a new activity after it is clicked on.
Is there some kind of Intent call that can do this? Thanks in advance!
Use getIntent(), instead of creating a new Intent.
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, getIntent(), 0);
.....
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
精彩评论