public class AutoStartReceiver extends BroadcastReceiver{
@Override
public void onReceive(Contextcontext, Intent intent) {
if (!AutoStarterService.isStart) {
Log.d(TAG, "@onReceiveNewsPushService will start");
context.startService(new Intent(context, AutoStarterService.class));
}
}
}
public class AutoStarterService extends Service {
private static final String TAG = "AutoStarterService";
public static boolean isStart =false;
@Override
public IBinderonBind(Intent intent) {
return null;
}
@Override
public void onCreate(){
Log.d(TAG, "AutoStarterServiceonCreate");