2016-05-19 10 views
-6

während läuft MyApp im Emulator, es installiert dann nach dem Login in 1. Seite zeigt es leider, MyApp hat aufgehört ... wie diesen Fehler zu überwinden?Leider hat MyApp gestoppt

Dies ist Show in Logcat ...

05-19 04:46:59.538 4109-4109/com.example.bharathi.m_box W/System: ClassLoader referenced unknown path: /data/app/com.example.bharathi.m_box-2/lib/x86 
05-19 04:46:59.926 4109-4109/com.example.bharathi.m_box 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 
05-19 04:47:00.000 4109-4109/com.example.bharathi.m_box I/TextInputLayout: EditText added is not a TextInputEditText. Please switch to using that class instead. 
05-19 04:47:00.003 4109-4109/com.example.bharathi.m_box I/TextInputLayout: EditText added is not a TextInputEditText. Please switch to using that class instead. 
05-19 04:47:00.099 4109-4140/com.example.bharathi.m_box D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true 
[ 05-19 04:47:00.108 4109: 4109 D/   ] 
HostConnection::get() New Host Connection established 0xe9891ce0, tid 4109 
05-19 04:47:00.196 4109-4140/com.example.bharathi.m_box D/libEGL: loaded /system/lib/egl/libEGL_emulation.so 
05-19 04:47:00.197 4109-4140/com.example.bharathi.m_box D/libEGL: loaded /system/lib/egl/libGLESv1_CM_emulation.so 
05-19 04:47:00.208 4109-4140/com.example.bharathi.m_box D/libEGL: loaded /system/lib/egl/libGLESv2_emulation.so 
[ 05-19 04:47:00.233 4109: 4140 D/   ] 
HostConnection::get() New Host Connection established 0xeea92750, tid 4140 
05-19 04:47:00.275 4109-4140/com.example.bharathi.m_box I/OpenGLRenderer: Initialized EGL, version 1.4 
05-19 04:47:00.396 4109-4140/com.example.bharathi.m_box W/EGL_emulation: eglSurfaceAttrib not implemented 
05-19 04:47:00.396 4109-4140/com.example.bharathi.m_box W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xeea93560, error=EGL_SUCCESS 
05-19 04:47:00.649 4109-4109/com.example.bharathi.m_box I/Choreographer: Skipped 30 frames! The application may be doing too much work on its main thread. 
05-19 04:47:01.196 4109-4109/com.example.bharathi.m_box I/Choreographer: Skipped 31 frames! The application may be doing too much work on its main thread. 
05-19 04:47:11.633 4109-4109/com.example.bharathi.m_box D/AndroidRuntime: Shutting down VM 


--------- beginning of crash 
05-19 04:47:11.633 4109-4109/com.example.bharathi.m_box E/AndroidRuntime: FATAL EXCEPTION: main 
Process: com.example.bharathi.m_box, PID: 4109 
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.bharathi.m_box/com.example.bharathi.m_box.MainActivity}: java.lang.ClassCastException: android.support.v7.widget.RecyclerView cannot be cast to android.widget.ListView 
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.ClassCastException: android.support.v7.widget.RecyclerView cannot be cast to android.widget.ListView 
at com.example.bharathi.m_box.MainActivity.onCreate(MainActivity.java:41) 
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)  
05-19 04:47:15.455 4109-4109/com.example.bharathi.m_box I/Process: Sending signal. PID: 4109 SIG: 9 
+0

Kannst du einen Code eingeben? Ich glaube, du bist mit ListView und Recyclerview in Verbindung geblieben. – Vasant

+2

'android.support.v7.widget.RecyclerView kann nicht in android.widget.ListView' umgewandelt werden -' RecyclerView' ist kein Ersatz für 'ListView'. – tynn

+0

Es sieht so aus, als würden Sie einen RecyclerView in einen ListView umwandeln. Bitte geben Sie einen Code ein. – Karl

Antwort

1

In Ihrem Layout, das Sie andere Ansicht verwenden, als Sie

android.support.v7.widget.RecyclerView cannot be cast to android.widget.ListView 

denken So sollten Sie entscheiden, ob Sie ListView oder RecyclerView verwenden und alles, was damit verbunden ist. Adapters und ViewHolder

mehr lesen here(ListView) und here(RecyclerView)

Verwandte Themen