Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 10-01 08:09:16.690: I/dalvikvm-heap(2115): Grow heap (frag case) to 6.026MB for 2536932-byte allocation
- 10-01 08:09:17.180: W/dalvikvm(2115): threadid=1: thread exiting with uncaught exception (group=0xb0d1ab20)
- 10-01 08:09:17.240: E/AndroidRuntime(2115): FATAL EXCEPTION: main
- 10-01 08:09:17.240: E/AndroidRuntime(2115): Process: com.example.jizhang, PID: 2115
- 10-01 08:09:17.240: E/AndroidRuntime(2115): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.jizhang/com.jaskey.jizhang.MainActivity}: java.lang.ClassCastException: android.widget.LinearLayout cannot be cast to android.support.v4.view.ViewPager
- 10-01 08:09:17.240: E/AndroidRuntime(2115): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
- 10-01 08:09:17.240: E/AndroidRuntime(2115): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
- 10-01 08:09:17.240: E/AndroidRuntime(2115): at android.app.ActivityThread.access$800(ActivityThread.java:135)
- 10-01 08:09:17.240: E/AndroidRuntime(2115): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
- 10-01 08:09:17.240: E/AndroidRuntime(2115): at android.os.Handler.dispatchMessage(Handler.java:102)
- 10-01 08:09:17.240: E/AndroidRuntime(2115): at android.os.Looper.loop(Looper.java:136)
- 10-01 08:09:17.240: E/AndroidRuntime(2115): at android.app.ActivityThread.main(ActivityThread.java:5017)
- 10-01 08:09:17.240: E/AndroidRuntime(2115): at java.lang.reflect.Method.invokeNative(Native Method)
- 10-01 08:09:17.240: E/AndroidRuntime(2115): at java.lang.reflect.Method.invoke(Method.java:515)
- 10-01 08:09:17.240: E/AndroidRuntime(2115): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
- 10-01 08:09:17.240: E/AndroidRuntime(2115): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
- 10-01 08:09:17.240: E/AndroidRuntime(2115): at dalvik.system.NativeStart.main(Native Method)
- 10-01 08:09:17.240: E/AndroidRuntime(2115): Caused by: java.lang.ClassCastException: android.widget.LinearLayout cannot be cast to android.support.v4.view.ViewPager
- 10-01 08:09:17.240: E/AndroidRuntime(2115): at com.jaskey.jizhang.MainActivity.onCreate(MainActivity.java:30)
- 10-01 08:09:17.240: E/AndroidRuntime(2115): at android.app.Activity.performCreate(Activity.java:5231)
- 10-01 08:09:17.240: E/AndroidRuntime(2115): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
- 10-01 08:09:17.240: E/AndroidRuntime(2115): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
- 10-01 08:09:17.240: E/AndroidRuntime(2115): ... 11 more
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- mPager=(ViewPager) findViewById(R.id.pager);//here where the error is thrown
- mPageAdpater=new MainPageAdpater(getSupportFragmentManager());
- mPager.setAdapter(mPageAdpater);
- <android.support.v4.view.ViewPager
- android:id="@+id/pager"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- />
- </LinearLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement