开发者

Clicking Widget mistakenly causes main Activity to launch

Widget Launches the Applications Main Activity unexpectedly. Should I just not have a Main activity when I have an app that hosts a widget? Not clear why it launches, but this is not the beha开发者_运维知识库vior I want. I want no activities to Launch unless they are specifically requested by intent to do so?


Try adding android:launchMode="singleInstance" to the main activity's definition in your manifest as suggested here.

<activity
android:name=".YourActivity"
android:launchMode="singleInstance" ...

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜