Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.95 KB | None | 0 0
  1. if (getIntent().hasExtra("key")) {
  2.  
  3. if(key.compareTo(App_id)==0)
  4. {
  5. setContentView(R.layout.home);
  6. }
  7.  
  8. }
  9. else {
  10.  
  11. finish();
  12. }
  13.  
  14. 03-20 13:47:30.270: E/AndroidRuntime(1628): FATAL EXCEPTION: main
  15. 03-20 13:47:30.270: E/AndroidRuntime(1628): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test/com.example.meetap.AdHome}: java.lang.NullPointerException
  16. 03-20 13:47:30.270: E/AndroidRuntime(1628): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1955)
  17. 03-20 13:47:30.270: E/AndroidRuntime(1628): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
  18. 03-20 13:47:30.270: E/AndroidRuntime(1628): at android.app.ActivityThread.access$600(ActivityThread.java:122)
  19. 03-20 13:47:30.270: E/AndroidRuntime(1628): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
  20. 03-20 13:47:30.270: E/AndroidRuntime(1628): at android.os.Handler.dispatchMessage(Handler.java:99)
  21. 03-20 13:47:30.270: E/AndroidRuntime(1628): at android.os.Looper.loop(Looper.java:137)
  22. 03-20 13:47:30.270: E/AndroidRuntime(1628): at android.app.ActivityThread.main(ActivityThread.java:4340)
  23. 03-20 13:47:30.270: E/AndroidRuntime(1628): at java.lang.reflect.Method.invokeNative(Native Method)
  24. 03-20 13:47:30.270: E/AndroidRuntime(1628): at java.lang.reflect.Method.invoke(Method.java:511)
  25. 03-20 13:47:30.270: E/AndroidRuntime(1628): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
  26. 03-20 13:47:30.270: E/AndroidRuntime(1628): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
  27. 03-20 13:47:30.270: E/AndroidRuntime(1628): at dalvik.system.NativeStart.main(Native Method)
  28. 03-20 13:47:30.270: E/AndroidRuntime(1628): Caused by: java.lang.NullPointerException
  29. 03-20 13:47:30.270: E/AndroidRuntime(1628): at com.example.meetap.AdHome.onCreate(AdHome.java:374)
  30. 03-20 13:47:30.270: E/AndroidRuntime(1628): at android.app.Activity.performCreate(Activity.java:4465)
  31. 03-20 13:47:30.270: E/AndroidRuntime(1628): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
  32. 03-20 13:47:30.270: E/AndroidRuntime(1628): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1919)
  33. 03-20 13:47:30.270: E/AndroidRuntime(1628): ... 11 more
  34.  
  35. Button close=(Button)findViewById(R.id.close);
  36. close.setOnClickListener(new OnClickListener()
  37. {
  38. public void onClick(View v)
  39. {
  40. finish();
  41. }
  42. });
  43.  
  44. Button close=(Button)findViewById(R.id.close);
  45. close.setOnClickListener(new OnClickListener()
  46. {
  47. public void onClick(View v)
  48. {
  49. finish();
  50. }
  51. });
  52.  
  53. View view = infalter.inflate(R.layout.customlayout,null);
  54. Button close=(Button)view.findViewById(R.id.close);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement