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

问题描述

应用程序运行正常....但是当我单击应该调出地图片段的图标时,它仍保留在当前片段上

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

标签: javaandroidgoogle-maps

解决方案


您在方法 inbreak的切换中case R.id.location缺少a ,这就是应用程序跳过位置并直接转到.onNavigationItemSelectedmenu.javacase R.id.add_friends

添加后break

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

选择后,您的 Map Activity 将毫无问题地启动。希望这可以帮助!:)


推荐阅读