2

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 activity 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);
    }
}
RivieraKid
  • 5,923
  • 4
  • 38
  • 47
user595226
  • 89
  • 3
  • 10

1 Answers1

9

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

Anju
  • 9,379
  • 14
  • 55
  • 94