Advertisement
Guest User

Untitled

a guest
Oct 1st, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.14 KB | None | 0 0
  1. 10-01 08:09:16.690: I/dalvikvm-heap(2115): Grow heap (frag case) to 6.026MB for 2536932-byte allocation
  2. 10-01 08:09:17.180: W/dalvikvm(2115): threadid=1: thread exiting with uncaught exception (group=0xb0d1ab20)
  3. 10-01 08:09:17.240: E/AndroidRuntime(2115): FATAL EXCEPTION: main
  4. 10-01 08:09:17.240: E/AndroidRuntime(2115): Process: com.example.jizhang, PID: 2115
  5. 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
  6. 10-01 08:09:17.240: E/AndroidRuntime(2115): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
  7. 10-01 08:09:17.240: E/AndroidRuntime(2115): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
  8. 10-01 08:09:17.240: E/AndroidRuntime(2115): at android.app.ActivityThread.access$800(ActivityThread.java:135)
  9. 10-01 08:09:17.240: E/AndroidRuntime(2115): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
  10. 10-01 08:09:17.240: E/AndroidRuntime(2115): at android.os.Handler.dispatchMessage(Handler.java:102)
  11. 10-01 08:09:17.240: E/AndroidRuntime(2115): at android.os.Looper.loop(Looper.java:136)
  12. 10-01 08:09:17.240: E/AndroidRuntime(2115): at android.app.ActivityThread.main(ActivityThread.java:5017)
  13. 10-01 08:09:17.240: E/AndroidRuntime(2115): at java.lang.reflect.Method.invokeNative(Native Method)
  14. 10-01 08:09:17.240: E/AndroidRuntime(2115): at java.lang.reflect.Method.invoke(Method.java:515)
  15. 10-01 08:09:17.240: E/AndroidRuntime(2115): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
  16. 10-01 08:09:17.240: E/AndroidRuntime(2115): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
  17. 10-01 08:09:17.240: E/AndroidRuntime(2115): at dalvik.system.NativeStart.main(Native Method)
  18. 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
  19. 10-01 08:09:17.240: E/AndroidRuntime(2115): at com.jaskey.jizhang.MainActivity.onCreate(MainActivity.java:30)
  20. 10-01 08:09:17.240: E/AndroidRuntime(2115): at android.app.Activity.performCreate(Activity.java:5231)
  21. 10-01 08:09:17.240: E/AndroidRuntime(2115): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
  22. 10-01 08:09:17.240: E/AndroidRuntime(2115): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
  23. 10-01 08:09:17.240: E/AndroidRuntime(2115): ... 11 more
  24.  
  25. @Override
  26. protected void onCreate(Bundle savedInstanceState) {
  27. super.onCreate(savedInstanceState);
  28. setContentView(R.layout.main);
  29.  
  30. mPager=(ViewPager) findViewById(R.id.pager);//here where the error is thrown
  31. mPageAdpater=new MainPageAdpater(getSupportFragmentManager());
  32. mPager.setAdapter(mPageAdpater);
  33.  
  34. <android.support.v4.view.ViewPager
  35. android:id="@+id/pager"
  36. android:layout_width="match_parent"
  37. android:layout_height="match_parent"
  38. />
  39. </LinearLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement