ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Android boot_complete
    Search: 카테고리 없음 카테고리 없음 2011. 12. 8. 18:50

    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"></uses-permission>

     <receiver android:name="com.XXXAdrReceiver1">
                <intent-filter>
                    <action android:name="android.intent.action.BOOT_COMPLETED"></action>
                    <category android:name="android.intent.category.LAUNCHER"></category>
                </intent-filter>
            </receiver>
     
    public class XXXAdrReceiver1 extends android.content.BroadcastReceiver {

    @Override public void onReceive(Context context, Intent intent) {
    if(intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
    context.startService(new Intent(context, com.XXMain.class));
    }
    }
    }

    댓글