rk3288平台,android7.1修改代码如下:
广播接收器:
public class BootBroadcastReceiver extends BroadcastReceiver {
private static final String TAG = "BootBroadcastReceiver";
private static final String ACTION_BOOT = "android.intent.action.BOOT_COMPLETED";
@Override
public void onReceive(Context context, Intent intent) {
Log.i(TAG, "wp----------->Boot this system , BootBroadcastReceiver onReceive()");
if (intent.getAction().equals(ACTION_BOOT)) {
Log.i(TAG, "BootBroadcastReceiver onReceive(), Do thing!");
String currentTag = SystemProperties.get("sys.color.temperature","7000");
Log.i(TAG, "BootBroadcastReceiver onReceive(), Do thing! currentTag = "+currentTag);
new CNDDisplay().writeColorTemperatureOption(currentTag);
//Intent tt = new Intent(context, MainActivity.class);
//context.startActivity(tt);
}
else if (intent.getAction().equals("android.intent.action.gmt.logupload")){
Log.i("wp add tag----------", "wangp------------->");
}
}
}androidmenifast文件:
<receiver android:name="com.android.settings.cnddisplay.BootBroadcastReceiver" >
<intent-filter >
<!--wp add-->
<action android:name="android.intent.action.gmt.logupload" />
<action android:name="abc" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</receiver>
用adb am 发送命令收不到广播,请问什么原因?
广播接收器:
public class BootBroadcastReceiver extends BroadcastReceiver {
private static final String TAG = "BootBroadcastReceiver";
private static final String ACTION_BOOT = "android.intent.action.BOOT_COMPLETED";
@Override
public void onReceive(Context context, Intent intent) {
Log.i(TAG, "wp----------->Boot this system , BootBroadcastReceiver onReceive()");
if (intent.getAction().equals(ACTION_BOOT)) {
Log.i(TAG, "BootBroadcastReceiver onReceive(), Do thing!");
String currentTag = SystemProperties.get("sys.color.temperature","7000");
Log.i(TAG, "BootBroadcastReceiver onReceive(), Do thing! currentTag = "+currentTag);
new CNDDisplay().writeColorTemperatureOption(currentTag);
//Intent tt = new Intent(context, MainActivity.class);
//context.startActivity(tt);
}
else if (intent.getAction().equals("android.intent.action.gmt.logupload")){
Log.i("wp add tag----------", "wangp------------->");
}
}
}androidmenifast文件:
<receiver android:name="com.android.settings.cnddisplay.BootBroadcastReceiver" >
<intent-filter >
<!--wp add-->
<action android:name="android.intent.action.gmt.logupload" />
<action android:name="abc" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</receiver>
用adb am 发送命令收不到广播,请问什么原因?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货