Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Nov 12th, 2012  |  syntax: Java  |  size: 3.30 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. package com.android.history;
  2.  
  3. import android.os.Bundle;
  4. import android.content.Intent;
  5. import android.support.v4.app.Fragment;
  6. import android.view.LayoutInflater;
  7. import android.view.View;
  8. import android.view.View.OnClickListener;
  9. import android.view.ViewGroup;
  10. import android.widget.ImageView;
  11. import android.widget.TextView;
  12.  
  13. public class MainActivity extends Fragment{
  14.        
  15.         //new EULA(this).show();
  16.        
  17.     @Override
  18.     public View onCreateView(LayoutInflater inflater, ViewGroup container,
  19.         Bundle savedInstanceState) {
  20.     View view = inflater.inflate(R.layout.main, container, false);
  21.            
  22.     ImageView imgView = (ImageView) view.findViewById(R.id.Drivers);
  23.     //TextView random = (TextView) view.findViewById(R.id.testbutton);
  24.    
  25.     imgView.setOnClickListener(new OnClickListener() {
  26.         public void onClick(View v) {
  27.                 Intent gotosomething = new Intent(getActivity(), DriversMain.class);
  28.                 startActivity(gotosomething);
  29.         }
  30.     });
  31.    
  32.  
  33. /*LOGCAT
  34.  
  35. 11-12 22:40:49.145: D/AndroidRuntime(11567): Shutting down VM
  36. 11-12 22:40:49.145: W/dalvikvm(11567): threadid=1: thread exiting with uncaught exception (group=0x40a451f8)
  37. 11-12 22:40:49.155: E/AndroidRuntime(11567): FATAL EXCEPTION: main
  38. 11-12 22:40:49.155: E/AndroidRuntime(11567): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.android.history/com.android.history.DriversMain}: java.lang.ClassCastException: com.android.history.DriversMain cannot be cast to android.app.Activity
  39. 11-12 22:40:49.155: E/AndroidRuntime(11567):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1993)
  40. 11-12 22:40:49.155: E/AndroidRuntime(11567):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2104)
  41. 11-12 22:40:49.155: E/AndroidRuntime(11567):    at android.app.ActivityThread.access$600(ActivityThread.java:132)
  42. 11-12 22:40:49.155: E/AndroidRuntime(11567):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1157)
  43. 11-12 22:40:49.155: E/AndroidRuntime(11567):    at android.os.Handler.dispatchMessage(Handler.java:99)
  44. 11-12 22:40:49.155: E/AndroidRuntime(11567):    at android.os.Looper.loop(Looper.java:137)
  45. 11-12 22:40:49.155: E/AndroidRuntime(11567):    at android.app.ActivityThread.main(ActivityThread.java:4575)
  46. 11-12 22:40:49.155: E/AndroidRuntime(11567):    at java.lang.reflect.Method.invokeNative(Native Method)
  47. 11-12 22:40:49.155: E/AndroidRuntime(11567):    at java.lang.reflect.Method.invoke(Method.java:511)
  48. 11-12 22:40:49.155: E/AndroidRuntime(11567):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
  49. 11-12 22:40:49.155: E/AndroidRuntime(11567):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
  50. 11-12 22:40:49.155: E/AndroidRuntime(11567):    at dalvik.system.NativeStart.main(Native Method)
  51. 11-12 22:40:49.155: E/AndroidRuntime(11567): Caused by: java.lang.ClassCastException: com.android.history.DriversMain cannot be cast to android.app.Activity
  52. 11-12 22:40:49.155: E/AndroidRuntime(11567):    at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
  53. 11-12 22:40:49.155: E/AndroidRuntime(11567):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1984)
  54. 11-12 22:40:49.155: E/AndroidRuntime(11567):    ... 11 more
  55. 11-12 22:40:51.144: I/Process(11567): Sending signal. PID: 11567 SIG: 9