Android-исключение в SplashScreen - PullRequest
0 голосов
/ 13 июня 2018
    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)

При открытии Splashscreen его приложение выходит из строя. В этой строке отображается ошибка, но не отображается сообщение об ошибке в logcat (new Handler (). PostDelayed(new Runnable ()). Это logcat, который отображается после сбоя приложения.

1 Ответ

0 голосов
/ 13 июня 2018

Код выглядит хорошо, возможно, проблема с импортом файлов R.

Удалить

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

Импортировать файл класса снова, используя Alt+Enter import class.

Зарегистрируйте SplashScreenActivity и PhoneNumberRegistration в файле манифеста.

Очистите и восстановите Запустите его снова, это может решить вашу проблему.

...