想实现 接收数据连接状态变化的广播事件,在Receiver中判断:if(intent.getAction().equals(Intent.DATA_CONNECTION_CHANGED_ACTION))总有错误:DATA_CONNECTION_CHANGED_ACTION cannot be resolved or is not a field在Manifest.xml 已经定义了:
<intent-filter>
<action android:name = "android.intent.action.BOOT_COMPLETED"/>
<action android:name = "android.intent.action.DATA_STATE"/>
</intent-filter>请高手指点下,是哪儿错误了。 相同的 处理:BOOT_COMPLETED,就没有问题,比如:if(intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED))就没有编译错误。
<intent-filter>
<action android:name = "android.intent.action.BOOT_COMPLETED"/>
<action android:name = "android.intent.action.DATA_STATE"/>
</intent-filter>请高手指点下,是哪儿错误了。 相同的 处理:BOOT_COMPLETED,就没有问题,比如:if(intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED))就没有编译错误。
要么自己定义,要么换用其他action。
http://developer.android.com/reference/packages.html