在Android 34中,应用程序崩溃与SecurityException: com.mgg.timmi: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
。
在Android 34中调用时发生此崩溃
new CarConnection(this).getType().observe(this, new Observer<Integer>() {
@Override
public void onChanged(Integer integer) {
Log.d(TAG, "CarConnection status changed");
}
});
字符串
Observer和Oberserverable已弃用,那么我还可以使用什么来检查设备是否与Android Car
连接。
我使用car.app:1.2.0
实现。
谢谢GGK
1条答案
按热度按时间gt0wga4j1#
对于在API 34或更高版本的设备上运行的面向API 34或更高版本的应用,您需要使用
1.3.0-beta01
或更高版本,如https://developer.android.com/training/cars/apps#car-connection所述。