java - Android 登录屏幕切换

标签 java android-studio switch-statement screen login-page

ANDROID STUDIO 登录切换至主要 Activity

这是它向我显示的错误

执行时出现意外错误:am start -n "com.company.appname/com.company.appname.MainActivity"-a android.intent.action.MAIN -c android.intent.category.LAUNCHER 启动 Activity 时出错

我正在开发一款社交应用程序,并尝试在进入应用程序后立即将屏幕切换到登录屏幕,但它在模拟器上不断崩溃,显示错误。

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity android:name=".LoginActivity"></activity>
    <activity android:name=".RegisterActivity" />
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

`

最佳答案

转到 logcat 并在下拉菜单中选择错误,看看 yohr 应用程序崩溃的原因。 如果您需要更多解释,请上传您的工作和 logcat 错误,以便我们可以看到实际发生的问题。

关于java - Android 登录屏幕切换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62172255/

相关文章:

php - 不间断的 switch 语句

java - 使用反射时出现空指针异常

java - 使用 pwdencrypt 时登录 从哪里开始?

android - 使用 Realm 存储 unicode 字符

java - 文件以 UTF-8 格式保存,但俄语中有奇怪的符号

java - Switch 语句和字符串

java - 为 Hibernate @ColumnTransformer 打开 JPA 等价物

java - `监控java中每个线程的cpu使用情况?

android - Android Studio 中的 "Failed to get the compiler information for file ..."

java - 为什么 JaCoCo 没有覆盖我的 String switch 语句?