猿问

当我按下开始按钮时,它应该进入下一个活动,但它会进入主屏幕

当我按下开始按钮时,它应该进入下一个活动,但它会进入主屏幕。我在添加横幅广告代码时遇到了这个问题。


Button 在 XML 代码中命名为 startbtn,在 Java 代码中命名为 btnclk1。我在 Android Studio 中做这个项目。


XML 代码:


    <?xml version="1.0" encoding="utf-8"?>

<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"

    xmlns:app="http://schemas.android.com/apk/res-auto"

    xmlns:ads="http://schemas.android.com/apk/res-auto"

    xmlns:tools="http://schemas.android.com/tools"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    android:background="@drawable/splashscr"

    tools:context=".SplashScreen">


    <Button

        android:id="@+id/startbtn2"

        android:layout_width="85dp"

        android:layout_height="32dp"

        android:layout_marginBottom="8dp"

        android:layout_marginEnd="8dp"

        android:layout_marginLeft="8dp"

        android:layout_marginRight="8dp"

        android:layout_marginStart="8dp"

        android:layout_marginTop="8dp"

        android:background="@android:color/black"

        android:text="Show Ad"

        android:textColor="@android:color/white"

        android:textSize="18sp"

        app:layout_constraintBottom_toBottomOf="parent"

        app:layout_constraintEnd_toEndOf="parent"

        app:layout_constraintStart_toStartOf="parent"

        app:layout_constraintTop_toTopOf="parent"

        app:layout_constraintVertical_bias="0.625" />


呼啦一阵风
浏览 90回答 1
1回答

MYYA

这是 logcat 所在的位置。请在此处发布可能在 logcat 中弹出的错误。
随时随地看视频慕课网APP

相关分类

Java
我要回答