80,493
社区成员
发帖
与我相关
我的任务
分享
<receiver android:name="com.huangcheng.Alarm.ServiceBC" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.HOME"/>
</intent-filter>
</receiver>
package com.huangcheng.Alarm;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class ServiceBC extends BroadcastReceiver{
@Override
public void onReceive(Context context, Intent arg1) {
// TODO Auto-generated method stub
Intent i = new Intent(context, yourActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
}
}