Passing data from activity A to B : Application Stopped Unexpectedly
<p>1.I was trying to pass an array of string from 1 activity to another but the application is giving "Application Stopped Unexpectedly".I am new to android and I don't know how to do it.</p>

<p>2.Can you please tell me how to tackle these runtime errors and how to use logcat I've no<br>
  idea?</p>

<p>Code Activity A:</p>

<pre><code>private OnClickListener mylistener=new OnClickListener() {

    @Override
    public void onClick(View arg0) {
        intent=new Intent(MsgSmsActivity.this,MsgSmsActivity2.class);
        MsgSmsActivity.this.startActivity(intent);
        intent.putExtra("bodyText", body);
        intent.putExtra("numbersText", number);

    }
};
</code></pre>

<p>Code Activity B:</p>

<pre><code>String[] arr;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // TODO Auto-generated method stub
    arr=new String[3];
    arr=getIntent().getExtras().getStringArray("bodyText");
    TextView tx=new TextView(this);
    tx.setText(arr[0]);
    setContentView(tx); 
}
</code></pre>

<p>The "body" and "number" are string arrays.  </p>

<p>Here is my LogCat:</p>

<pre><code>03-21 13:07:03.477: ERROR/Zygote(32): setreuid() failed. errno: 2&lt;br&gt;
03-21 13:07:14.976: ERROR/Zygote(32): setreuid() failed. errno: 17&lt;br&gt;
03-21 13:07:17.116: ERROR/BatteryService(76): usbOnlinePath not found&lt;br&gt;
03-21 13:07:17.116: ERROR/BatteryService(76): batteryVoltagePath not found&lt;br&gt;
03-21 13:07:17.116: ERROR/BatteryService(76): batteryTemperaturePath not found&lt;br&gt;
03-21 13:07:17.156: ERROR/SurfaceFlinger(76): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake&lt;br&gt;
03-21 13:07:17.386: ERROR/SensorService(76): couldn't open device for module sensors (Invalid argument)&lt;br&gt;
03-21 13:07:43.016: ERROR/System(76): Failure starting core service&lt;br&gt;
03-21 13:07:43.016: ERROR/System(76): java.lang.SecurityException&lt;br&gt;
03-21 13:07:43.016: ERROR/System(76):     at android.os.BinderProxy.transact(Native Method)&lt;br&gt;
03-21 13:07:43.016: ERROR/System(76):     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)&lt;br&gt;
03-21 13:07:43.016: ERROR/System(76):     at android.os.ServiceManager.addService(ServiceManager.java:72)&lt;br&gt;
03-21 13:07:43.016: ERROR/System(76):     at com.android.server.ServerThread.run(SystemServer.java:206)&lt;br&gt;
03-21 13:07:43.056: ERROR/EventHub(76): could not get driver version for /dev/input/mouse0, Not a typewriter&lt;br&gt;
03-21 13:07:43.056: ERROR/EventHub(76): could not get driver version for /dev/input/mice, Not a typewriter&lt;br&gt;
03-21 13:07:43.756: ERROR/SoundPool(76): error loading /system/media/audio/ui/Effect_Tick.ogg&lt;br&gt;
03-21 13:07:43.766: ERROR/SoundPool(76): error loading /system/media/audio/ui/KeypressStandard.ogg&lt;br&gt;
03-21 13:07:43.766: ERROR/SoundPool(76): error loading /system/media/audio/ui/KeypressSpacebar.ogg&lt;br&gt;
03-21 13:07:43.766: ERROR/SoundPool(76): error loading /system/media/audio/ui/KeypressDelete.ogg&lt;br&gt;
03-21 13:07:43.776: ERROR/SoundPool(76): error loading /system/media/audio/ui/KeypressReturn.ogg&lt;br&gt;
03-21 13:07:43.806: ERROR/UsbObserver(76): java.lang.NullPointerException&lt;br&gt;
03-21 13:07:43.806: ERROR/UsbObserver(76):     at com.android.server.UsbObserver.init(UsbObserver.java:131)&lt;br&gt;
03-21 13:07:43.806: ERROR/UsbObserver(76):     at com.android.server.UsbObserver.&lt;init&gt;(UsbObserver.java:65)&lt;br&gt;
03-21 13:07:43.806: ERROR/UsbObserver(76):     at com.android.server.ServerThread.run(SystemServer.java:402)&lt;br&gt;
03-21 13:07:48.077: ERROR/ThrottleService(76): Could not open GPS configuration file /etc/gps.conf&lt;br&gt;
03-21 13:07:48.128: ERROR/ThrottleService(76): Error reading data file&lt;br&gt;
03-21 13:07:48.606: ERROR/logwrapper(172): executing /system/bin/tc failed: No such file or directory&lt;br&gt;
03-21 13:07:48.687: ERROR/logwrapper(174): executing /system/bin/tc failed: No such file or directory&lt;br&gt;
03-21 13:07:48.756: ERROR/logwrapper(177): executing /system/bin/tc failed: No such file or directory&lt;br&gt;
03-21 13:07:54.707: ERROR/logwrapper(213): executing /system/bin/tc failed: No such file or directory&lt;br&gt;
03-21 13:07:54.737: ERROR/logwrapper(214): executing /system/bin/tc failed: No such file or directory&lt;br&gt;
03-21 13:07:54.767: ERROR/logwrapper(215): executing /system/bin/tc failed: No such file or directory&lt;br&gt;
03-21 18:08:58.619: ERROR/MetadataRetrieverClient(33): failed to extract an album art&lt;br&gt;
03-21 18:09:17.207: ERROR/ThrottleService(76): Error reading data file&lt;br&gt;
03-21 18:25:23.387: ERROR/InputDispatcher(76): channel '40517da8 com.example.ssms/com.example.ssms.MsgSmsActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x8&lt;br&gt;
03-21 18:25:23.387: ERROR/InputDispatcher(76): channel '40517da8 com.example.ssms/com.example.ssms.MsgSmsActivity (server)' ~ Channel is unrecoverably broken and will be disposed!&lt;br&gt;
03-21 18:25:31.837: ERROR/AndroidRuntime(439): FATAL EXCEPTION: main&lt;br&gt;
03-21 18:25:31.837: ERROR/AndroidRuntime(439): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.ssms/com.example.ssms.MsgSmsActivity2}: java.lang.NullPointerException&lt;br&gt;
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1622)&lt;br&gt;
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)&lt;br&gt;
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)&lt;br&gt;
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)&lt;br&gt;
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at android.os.Handler.dispatchMessage(Handler.java:99)&lt;br&gt;
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at android.os.Looper.loop(Looper.java:123)&lt;br&gt;
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at android.app.ActivityThread.main(ActivityThread.java:3647)&lt;br&gt;
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at java.lang.reflect.Method.invokeNative(Native Method)&lt;br&gt;
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at java.lang.reflect.Method.invoke(Method.java:507)&lt;br&gt;
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)&lt;br&gt;
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)&lt;br&gt;
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at dalvik.system.NativeStart.main(Native Method)&lt;br&gt;
03-21 18:25:31.837: ERROR/AndroidRuntime(439): Caused by: java.lang.NullPointerException&lt;br&gt;
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at com.example.ssms.MsgSmsActivity2.onCreate(MsgSmsActivity2.java:23)&lt;br&gt;
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)&lt;br&gt;
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1586)&lt;br&gt;
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     ... 11 more
</code></pre>
