2016-05-19 9 views
-6

を停止していますが、エミュレータでMyAppを実行していますが、最初のページにログインした後、残念ながらMyAppが停止しています... このエラーを解決するには?残念ながら、MyAppは、

これは、あなたが

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

ですから、あなたがListViewRecyclerViewを使用するかどうかを決定すべきだと思うよりも、...あなたが他のビューを使用します。レイアウトで

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

あなたはいくつかのコードを置くことができますか?あなたはlistviewとrecyclerviewを使ってメッシュを張っていると思います。 – Vasant

+2

'android.support.v7.widget.RecyclerViewはandroid.widget.ListView'にキャストできません。 - ' RecyclerView'は 'ListView'の代わりにはありません。 – tynn

+0

RecyclerViewをListViewにキャストしているようです。いくつかのコードを入力してください。 – Karl

答えて

1

Logcatでショーですそれに接続されているすべて。 Adapters

ViewHolderhere(ListView)

関連する問題