使用其他viewPager时,应用程序会消失

时间:2018-12-24 14:26:40

标签: android crash android-viewpager

我在主页的一部分中有一个滚动的YouTube流媒体列表,该列表由bottomAppBartoolBar组成,整个中间部分为scrollable。我在中间使用fragments。我在主pageViewer中使用了activity_xml。 问题是。 当我使用此pageViewer时。

<androidx.viewpager.widget.ViewPager

该应用程序不会崩溃,并且可以正常运行。但是我看不到(通过设计xml)通过此pageViewer在片段布局中添加的内容。

但是当我添加此pageView时。

  <android.support.v4.view.ViewPager

我能够(在设计xml中)看到我在fragment布局中添加的内容,但是应用程序在播放时立即崩溃

这在日志中显示

12-24 20:21:48.631 22109-22109/? D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
12-24 20:21:48.852 22109-22109/? I/CrashlyticsCore: Initializing Crashlytics 2.6.6.29
12-24 20:21:48.936 22109-22109/? I/CrashlyticsInitProvider: CrashlyticsInitProvider initialization successful
12-24 20:22:01.295 938-948/? D/SettingsInterface:  from settings cache , name = dropbox:data_app_crash , value = null
12-24 20:22:01.297 938-22264/? D/SettingsInterface:  from settings cache , name = logcat_for_data_app_crash , value = null
12-24 20:22:01.297 938-22264/? D/SettingsInterface:  from settings cache , name = dropbox:data_app_crash , value = null
12-24 20:22:01.298 938-22264/? D/SettingsInterface:  from settings cache , name = dropbox:data_app_crash , value = null
12-24 20:22:01.301 938-22264/? W/DropBoxManagerService: Dropping: data_app_crash (10 > 0 bytes)
12-24 20:22:01.308 938-22264/? D/AES:       cause : data_app_crash

1 个答案:

答案 0 :(得分:0)

如果您使用的是androidX,则无法使用xml元素或Java代码的支持库,请尝试将android studio更新为最新版本,并将androidx lib也更新为最新版本,这将修复android studio的预览。 / p>