开发者

How to leave an Android activity when called through widget

开发者 https://www.devze.com 2023-03-30 21:53 出处:网络
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

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).

0

精彩评论

暂无评论...
验证码 换一张
取 消