How to leave an Android activity when called through widget
I have an application with several activities, services and also an app widget. The widget invokes one of the non-Main activities and I would like the activity to finish, thereby returning the user to the screen where they tapped the widget. Instead, when I call finish() from the activity, the Main activity screen appears! This Main activity was never invoked, so I am unsure how it became involved. I have experimented with Intent extras to bypass presenting the main screen in its onCreate()/onResum开发者_如何学编程e() but so far nothing has worked. Has anyone tackled this?
The main activity will only appear if you haven't finished it before starting the widget activity (assuming of course you didn't call it by mistake from the activity started by the widget).
精彩评论