将谷歌地图实现为片段后,我在运行块中没有收到任何错误,但片段没有在我的设备上显示地图



应用程序运行正常。。。。但当我点击应该显示地图片段的图标时,它会保留在当前片段上

runtime block ::: /.example.findm: Unsupported class loader
W/.example.findm: Skipping duplicate class check due to unsupported classloader
I/Google Maps Android API: Google Play services client version: 12451000
W/RenderThread: type=1400 audit(0.0:412457): avc: denied { search } for name="battery" dev="sysfs" ino=7011 scontext=u:r:untrusted_app:s0:c174,c256,c512,c768 tcontext=u:object_r:sysfs_batteryinfo:s0 tclass=dir permissive=0
I/Google Maps Android API: Google Play services package version: 19530035
W/.example.findm: Accessing hidden field Ljava/nio/Buffer;->address:J (light greylist, reflection)
I/.example.findm: The ClassLoaderContext is a special shared library.

运行时显示的图像

这是我的应用程序代码的git链接https://github.com/wisdom3541/findme

您在menu.java中的onNavigationItemSelected方法的开关case R.id.location中缺少一个break,这就是应用程序跳过位置并直接转到case R.id.add_friends的原因。

添加break:后

case R.id.location:
getSupportFragmentManager().beginTransaction().replace(R.id.frag_cont, new currentlocation()).commit();
break;

选择后,地图活动将毫无问题地启动。希望这能有所帮助!:(

最新更新