我正在尝试通过遵循本文实现对我的android应用程序的启动屏幕 。我已逐步遵循它,但是每当我尝试运行该应用程序时,它都会立即崩溃,并且在logcat中出现以下错误:
2019-01-05 10:46:33.682 2265-2265/com.example.khoi.parkingapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.khoi.parkingapp, PID: 2265
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.khoi.parkingapp/com.example.khoi.parkingapp.SplashActivity}: android.content.res.Resources$NotFoundException: Drawable com.example.khoi.parkingapp:drawable/splash_background with resource ID #0x7f07008d
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2955)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3030)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6938)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Caused by: android.content.res.Resources$NotFoundException: Drawable com.example.khoi.parkingapp:drawable/splash_background with resource ID #0x7f07008d
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/splash_background.xml from drawable resource ID #0x7f07008d
at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:837)
at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:659)
at android.content.res.Resources.getDrawableForDensity(Resources.java:891)
at android.content.res.Resources.getDrawable(Resources.java:833)
at android.content.Context.getDrawable(Context.java:605)
at …Run Code Online (Sandbox Code Playgroud) 我上传了一个 Android 应用程序到 google play 商店,并且我有商店信息的英文和中文内容(描述、简短说明等...我的默认语言是英语,但我试图弄清楚如何才能看到其他语言的列表?我需要在其中输入语言代码的 URL 中是否有额外的参数?
我尝试在我的应用程序网址末尾添加一个额外的参数;&hl=zh,但它实际上并没有将内容更新为我在控制台中的中文内容,它仍然是英文的:
https://play.google.com/store/apps/details?id=com.{myapp}&hl=zh
我有一个在我的应用程序中实现的底部导航视图。它有 3 个图标:
这就是我的 MapsActivity 的样子
所以我已经成功地显示了片段 A 和 B。但似乎我在 xml 中的某个地方搞乱了片段(我是新人,所以我仍在尝试围绕 xml 的布局进行思考),如果我单击屏幕顶部搜索栏来自 MapsActivity 的位置,然后搜索栏将显示,就像我的片段是“透明”的,但您实际上无法在片段上看到搜索栏。
这就是我的意思:
我如何让我的片段 A 和 B 完全覆盖下面的活动,这样它们就不是“透明的”
活动地图.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/fragmentContainer">
<fragment
android:id="@+id/place_autocomplete_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:name="com.google.android.gms.location.places.ui.PlaceAutocompleteFragment"
/>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/map"
tools:context=".MapsActivity"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_below="@id/place_autocomplete_fragment"
android:layout_above="@id/bottom_navigation"
/>
<android.support.design.widget.BottomNavigationView
android:id="@+id/bottom_navigation"
app:menu="@menu/bottom_nav_menu"
android:background="@color/colorPrimaryDark"
android:layout_width="match_parent"
app:itemIconTint="@color/common_google_signin_btn_text_dark_default"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_marginBottom="0dp"
android:layout_alignParentLeft="true" android:layout_marginLeft="0dp"
android:layout_alignParentStart="true" android:layout_marginStart="0dp"/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
片段_a.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/common_google_signin_btn_text_dark_pressed">
<TextView …Run Code Online (Sandbox Code Playgroud) android android-fragments android-activity kotlin bottomnavigationview