开发者

How to call An activity class from a service class

In my app there is a service class and need to call an activity class from that service class,but it each time while calling the acti开发者_如何学编程vity class its show me a message that application is not responding ,and below is my code..

public class MyAlarmService_Movie extends Service {
    @Override
    public void onCreate() {
        super.onStart(intent, startId);
        Intent in=new Intent().setClass(MyAlarmService.this,Reminder.class);
        startActivity(in);
    }
}


Give in.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); before starting the intent.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜