Today, write the login registration page, click the "registration" button on the login page, the software suddenly crashes, flies back directly, because novice, can only go online search. Although there are many online solutions, they have not been found feasible. When I think about it, I can see Logcat, run the application again immediately, and look at the log when it crashes. I find that there are many logs and I don't know them yet. So I have to copy the log to search on the internet, which is fruitless. Suddenly, the registration page about the Toolbar content deletion, re-run the application, even successfully switched from the login page to the registration page. It may be that the Toolbar of the registration page conflicts with the login page. The specific reason is not clear, so we can only use the Toolbar first.
Logcat
11-17 08:36:20.241 2389-2389/? E/libprocessgroup: failed to make and chown /acct/uid_10066: Read-only file system
11-17 08:36:20.241 2389-2389/? W/Zygote: createProcessGroup failed, kernel missing CONFIG_CGROUP_CPUACCT?
11-17 08:36:20.241 2389-2389/? I/art: Late-enabling -Xcheck:jni
11-17 08:36:20.346 2389-2389/com.example.zz.ebuy W/System: ClassLoader referenced unknown path: /data/app/com.example.zz.ebuy-1/lib/x86
11-17 08:36:20.375 2389-2389/com.example.zz.ebuy W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
11-17 08:36:20.454 2389-2402/com.example.zz.ebuy D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
[ 11-17 08:36:20.494 2389: 2389 D/ ]
HostConnection::get() New Host Connection established 0xed656860, tid 2389
11-17 08:36:21.046 2389-2402/com.example.zz.ebuy D/libEGL: loaded /system/lib/egl/libEGL_emulation.so
11-17 08:36:21.047 2389-2402/com.example.zz.ebuy D/libEGL: loaded /system/lib/egl/libGLESv1_CM_emulation.so
11-17 08:36:21.066 2389-2402/com.example.zz.ebuy D/libEGL: loaded /system/lib/egl/libGLESv2_emulation.so
[ 11-17 08:36:21.089 2389: 2402 D/ ]
HostConnection::get() New Host Connection established 0xeea12890, tid 2402
11-17 08:36:21.142 2389-2402/com.example.zz.ebuy I/OpenGLRenderer: Initialized EGL, version 1.4
11-17 08:36:21.384 2389-2402/com.example.zz.ebuy W/EGL_emulation: eglSurfaceAttrib not implemented
11-17 08:36:21.384 2389-2402/com.example.zz.ebuy W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xeea13560, error=EGL_SUCCESS
11-17 08:36:24.441 2389-2389/com.example.zz.ebuy D/AndroidRuntime: Shutting down VM
11-17 08:36:24.442 2389-2389/com.example.zz.ebuy E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.zz.ebuy, PID: 2389
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.zz.ebuy/com.example.zz.ebuy.SignUp}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.Toolbar.setLogo(int)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.Toolbar.setLogo(int)' on a null object reference
at com.example.zz.ebuy.SignUp.onCreate(SignUp.java:33)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
11-17 08:36:28.615 2389-2389/com.example.zz.ebuy I/Process: Sending signal. PID: 2389 SIG: 9
Toolbar code
1 Toolbar toolbar = findViewById(R.id.toolbar); 2 setSupportActionBar(toolbar); 3 toolbar.setLogo(R.drawable.ebuy); 4 toolbar.setTitle("eBuy");