Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix "Unable to start activity ComponentInfo" error
04-02 15:04:28.194 14490-14490/com.example.androidforios.app E/AndroidRuntime﹕ FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.androidforios.app/com.example.androidforios.app.activities.TripDetailActivity}: java.lang.IllegalStateException: Cannot add header view to list -- setAdapter has already been called. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261) at android.app.ActivityThread.access$600(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5103) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.IllegalStateException: Cannot add header view to list -- setAdapter has already been called. at android.widget.ListView.addHeaderView(ListView.java:258) at android.widget.ListView.addHeaderView(ListView.java:287) at com.example.androidforios.app.fragments.TripDetailFragment.onViewCreated(TripDetailFragment.java:73) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:941) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104) at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1467) at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:570) at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1171) at android.app.Activity.performStart(Activity.java:5143) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261) at android.app.ActivityThread.access$600(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5103) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) at dalvik.system.NativeStart.main(Native Method)
- Loading branch information