public class test extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
Toast.makeText(context, "开机启动广播", 1).show();
}}
--------------------------------------------------------------
<receiver android:name=".test" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</receiver>
-----------------------------------------
在4.0系统上不可以运行。在2.3.6系统上可以的。为什么。我用三星9100,4.0系统测试不可以。
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
Toast.makeText(context, "开机启动广播", 1).show();
}}
--------------------------------------------------------------
<receiver android:name=".test" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</receiver>
-----------------------------------------
在4.0系统上不可以运行。在2.3.6系统上可以的。为什么。我用三星9100,4.0系统测试不可以。
解决方案 »
- 如何通过动态设定ImageView控件的位置而不通过XML文件
- 没有正常关闭eclipse后来再使用eclipse时打不开layout里面的xml文件了,没有响应怎么办
- 这个data是什么值啊?
- listview 刷新问题,小弟新手,找了很多都没弄懂,
- android消息推送怎么做?
- 一个空指针异常,求解决
- android setContentView()方法报错
- Android libs/armeabi/libffmpeg.so文件重命名
- 关于安卓开发的电脑配置问题
- 小米手机获取未接来电时incomingnumber为null,求大神解释
- 请教android遍地都是的sp问题
- Activity 重新返回栈顶
startIntent.putExtra("pkg", getPackageName());
startIntent.setAction("com.lenovo.speechcamera.start");
startIntent.setFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
sendBroadcast(startIntent);