启动画面中的安卓异常


package com.example.activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import com.example.NewActivity.PhoneNumberRegistration;
import com.example.aayushchaubey.meetdax.R;
public class SplashScreenActivity extends AppCompatActivity {
private static int SPLASH_TIME_OUT = 3000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
new Handler().postDelayed(new Runnable() {
/*
* Showing splash screen with a timer. This will be useful when you
* want to show case your app logo / company
*/
@Override
public void run() {
// This method will be executed once the timer is over
// Start your app main activity
//                ProgressDialog progressDialog = new ProgressDialog(SplashScreenActivity.this);
//                progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
//                progressDialog.setMessage("Please wait");
//                progressDialog.setCancelable(false);
//                progressDialog.show();
Intent i = new Intent(SplashScreenActivity.this, PhoneNumberRegistration.class);
startActivity(i);
// close this activity
finish();
}
}, SPLASH_TIME_OUT);
}
}

错误是:-

art/runtime/runtime.cc:422]   native: #55 pc 000000000026770c  /system/lib64/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+184)
art/runtime/runtime.cc:422]   native: #56 pc 0000000000288634  /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+564)
art/runtime/runtime.cc:422]   native: #57 pc 00000000002b80a0  /system/lib64/libart.so (_ZN3art11interpreterL8DoInvokeILNS_10InvokeTypeE2ELb0ELb0EEEbPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+612)
art/runtime/runtime.cc:422]   native: #58 pc 00000000002abd78  /system/lib64/libart.so (_ZN3art11interpreter17ExecuteSwitchImplILb0ELb0EEENS_6JValueEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameES2_b+17508)
art/runtime/runtime.cc:422]   native: #59 pc 0000000000261a14  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+484)
art/runtime/runtime.cc:422]   native: #60 pc 000000000054bee8  /system/lib64/libart.so (artQuickToInterpreterBridge+812)
art/runtime/runtime.cc:422]   native: #61 pc 00000000000dc1ac  /system/lib64/libart.so (art_quick_to_interpreter_bridge+92)
art/runtime/runtime.cc:422]   native: #62 pc 00000000008f8618  /system/framework/arm64/boot-framework.oat (???)
art/runtime/runtime.cc:422]   at com.example.activity.SplashScreenActivity.onCreate(SplashScreenActivity.java:16)
art/runtime/runtime.cc:422]   at android.app.Activity.performCreate(Activity.java:6992)
art/runtime/runtime.cc:422]   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
art/runtime/runtime.cc:422]   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)

当启动画面打开时,其应用程序崩溃。在这一行中,它显示错误,但在logcat(new Handler((.postDelayed(new Runnable(((中没有显示错误消息。这是应用程序崩溃后显示的日志猫。

代码看起来不错,导入 R 文件时可能存在问题。

删除

import com.example.NewActivity.PhoneNumberRegistration;
import com.example.aayushchaubey.meetdax.R;

使用导入类再次导入类文件Alt+Enter

SplashScreenActivityPhoneNumberRegistration注册到清单文件。

清理并重建 再次运行它可能会解决您的问题。

最新更新