开发者

Clicking Widget mistakenly causes main Activity to launch

开发者 https://www.devze.com 2023-02-10 16:44 出处:网络
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开发者_运维

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

精彩评论

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