Advertisement
simondid

problem

Jan 5th, 2012
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.85 KB | None | 0 0
  1. hey all.
  2. so im traying to use the slid animation from android sampels 2,0,1 but when i but when im Switching the UI i also wan't to start using a new class / java file insted off using the same what i have trayed is
  3.  
  4. ViewFlipper vf = (ViewFlipper) findViewById(R.id.details);
  5.  
  6. // Set an animation from res/anim: I pick push left in
  7. vf.setAnimation(AnimationUtils.loadAnimation(view.getContext(), R.anim.push_left_in));
  8.  
  9. vf.showNext();
  10.  
  11. startActivity(i);
  12.  
  13. but it is creashing with a null point exeception
  14.  
  15. 01-06 00:20:21.373: E/AndroidRuntime(2982): FATAL EXCEPTION: main
  16. 01-06 00:20:21.373: E/AndroidRuntime(2982): java.lang.RuntimeException: Unable to start activity ComponentInfo{simon.vestergaard.note.calender/simon.vestergaard.note.calender.NoteSelector}: java.lang.NullPointerException
  17. 01-06 00:20:21.373: E/AndroidRuntime(2982): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1955)
  18. 01-06 00:20:21.373: E/AndroidRuntime(2982): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
  19. 01-06 00:20:21.373: E/AndroidRuntime(2982): at android.app.ActivityThread.access$600(ActivityThread.java:122)
  20. 01-06 00:20:21.373: E/AndroidRuntime(2982): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
  21. 01-06 00:20:21.373: E/AndroidRuntime(2982): at android.os.Handler.dispatchMessage(Handler.java:99)
  22. 01-06 00:20:21.373: E/AndroidRuntime(2982): at android.os.Looper.loop(Looper.java:137)
  23. 01-06 00:20:21.373: E/AndroidRuntime(2982): at android.app.ActivityThread.main(ActivityThread.java:4340)
  24. 01-06 00:20:21.373: E/AndroidRuntime(2982): at java.lang.reflect.Method.invokeNative(Native Method)
  25. 01-06 00:20:21.373: E/AndroidRuntime(2982): at java.lang.reflect.Method.invoke(Method.java:511)
  26. 01-06 00:20:21.373: E/AndroidRuntime(2982): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
  27. 01-06 00:20:21.373: E/AndroidRuntime(2982): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
  28. 01-06 00:20:21.373: E/AndroidRuntime(2982): at dalvik.system.NativeStart.main(Native Method)
  29. 01-06 00:20:21.373: E/AndroidRuntime(2982): Caused by: java.lang.NullPointerException
  30. 01-06 00:20:21.373: E/AndroidRuntime(2982): at simon.vestergaard.note.calender.NoteSelector.initilize(NoteSelector.java:65)
  31. 01-06 00:20:21.373: E/AndroidRuntime(2982): at simon.vestergaard.note.calender.NoteSelector.onCreate(NoteSelector.java:53)
  32. 01-06 00:20:21.373: E/AndroidRuntime(2982): at android.app.Activity.performCreate(Activity.java:4465)
  33. 01-06 00:20:21.373: E/AndroidRuntime(2982): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
  34. 01-06 00:20:21.373: E/AndroidRuntime(2982): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1919)
  35. 01-06 00:20:21.373: E/AndroidRuntime(2982): ... 11 more
  36.  
  37.  
  38.  
  39.  
  40. this is my oncreate
  41.  
  42. protected void onCreate(Bundle savedInstanceState) {
  43. // TODO Auto-generated method stub
  44. super.onCreate(savedInstanceState);
  45.  
  46. // setContentView(R.layout.noteselectorscreen);
  47.  
  48. initilize();
  49. }
  50.  
  51. private void initilize() {
  52. // TODO Auto-generated method stub
  53. Bback =(Button)findViewById(R.id.Bback);
  54. Bnew =(Button)findViewById(R.id.Bnew);
  55. LMain =(ListView) findViewById(R.id.LnoteSelector);
  56. tCatagoryName=(TextView)findViewById(R.id.TcatagoryName);
  57. TVtopText =(TextView)findViewById(R.id.TVtopText);
  58.  
  59.  
  60. Bback.setOnClickListener(this);
  61. Bnew.setOnClickListener(this);
  62. LMain.setOnItemClickListener(this);
  63.  
  64. aa = new FancyAdapter();
  65. LMain.setAdapter(aa);
  66. FillListDataWithData();
  67. String caragorynameHeader =mainClass.getSelectedCategory();
  68. tCatagoryName.setText(""+caragorynameHeader);
  69. TVtopText.setText(R.string.app_name);
  70.  
  71. }
  72.  
  73. the app is creahing one line 65 with is Bback.setOnClickListener(this);
  74. how can i make this work??
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement