开发者

Android, start activity from service?

开发者 https://www.devze.com 2023-03-17 17:53 出处:网络
Trying to start activity from service started at BOO开发者_StackOverflowT, but log shows how application dies (don\'t know why exactly) and restarts and tries again and again..

Trying to start activity from service started at BOO开发者_StackOverflowT, but log shows how application dies (don't know why exactly) and restarts and tries again and again..

I've tried differents ways of starting activity, like

Intent newUserForm = new Intent(_context, NewUserForm.class);
newUserForm.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK );
_context.startActivity(newUserForm);

Why is my app dying (and restarting) and I'm not able to start activity from service? Thank you!!!!!!


Broadcast one Intent from service and make sure you'll receive that Intent from your application side (broadcast receiver).


Set up a broadcast receiver, and start the service from there.

0

精彩评论

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