import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
public class MyBootStartUpListener extends BroadcastReceiver{
private static final String TAG = MyBootStartUpListener.class.getSimpleName();
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
Log.d(TAG, "My BootStartup");
try{
Intent homeIntent = new Intent(context,bootStartupActivity.class);
homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(homeIntent);
}catch(Exception e){
System.err.println(e);
}
Log.d(TAG, "My BootStartup succefully");
}
}
receiver android:name=".MyBootStartUpListener"
intent-filter
action android:name="android.intent.action.BOOT_COMPLETED"
category android:name="android.intent.category.HOME"
intent-filter
receiver
No comments:
Post a Comment