Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7690327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:22:12+00:00 2026-05-31T20:22:12+00:00

1.I was trying to pass an array of string from 1 activity to another

  • 0

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.

2.Can you please tell me how to tackle these runtime errors and how to use logcat I’ve no
idea?

Code Activity A:

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 Activity B:

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); 
}

The “body” and “number” are string arrays.

Here is my LogCat:

03-21 13:07:03.477: ERROR/Zygote(32): setreuid() failed. errno: 2<br>
03-21 13:07:14.976: ERROR/Zygote(32): setreuid() failed. errno: 17<br>
03-21 13:07:17.116: ERROR/BatteryService(76): usbOnlinePath not found<br>
03-21 13:07:17.116: ERROR/BatteryService(76): batteryVoltagePath not found<br>
03-21 13:07:17.116: ERROR/BatteryService(76): batteryTemperaturePath not found<br>
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<br>
03-21 13:07:17.386: ERROR/SensorService(76): couldn't open device for module sensors (Invalid argument)<br>
03-21 13:07:43.016: ERROR/System(76): Failure starting core service<br>
03-21 13:07:43.016: ERROR/System(76): java.lang.SecurityException<br>
03-21 13:07:43.016: ERROR/System(76):     at android.os.BinderProxy.transact(Native Method)<br>
03-21 13:07:43.016: ERROR/System(76):     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)<br>
03-21 13:07:43.016: ERROR/System(76):     at android.os.ServiceManager.addService(ServiceManager.java:72)<br>
03-21 13:07:43.016: ERROR/System(76):     at com.android.server.ServerThread.run(SystemServer.java:206)<br>
03-21 13:07:43.056: ERROR/EventHub(76): could not get driver version for /dev/input/mouse0, Not a typewriter<br>
03-21 13:07:43.056: ERROR/EventHub(76): could not get driver version for /dev/input/mice, Not a typewriter<br>
03-21 13:07:43.756: ERROR/SoundPool(76): error loading /system/media/audio/ui/Effect_Tick.ogg<br>
03-21 13:07:43.766: ERROR/SoundPool(76): error loading /system/media/audio/ui/KeypressStandard.ogg<br>
03-21 13:07:43.766: ERROR/SoundPool(76): error loading /system/media/audio/ui/KeypressSpacebar.ogg<br>
03-21 13:07:43.766: ERROR/SoundPool(76): error loading /system/media/audio/ui/KeypressDelete.ogg<br>
03-21 13:07:43.776: ERROR/SoundPool(76): error loading /system/media/audio/ui/KeypressReturn.ogg<br>
03-21 13:07:43.806: ERROR/UsbObserver(76): java.lang.NullPointerException<br>
03-21 13:07:43.806: ERROR/UsbObserver(76):     at com.android.server.UsbObserver.init(UsbObserver.java:131)<br>
03-21 13:07:43.806: ERROR/UsbObserver(76):     at com.android.server.UsbObserver.<init>(UsbObserver.java:65)<br>
03-21 13:07:43.806: ERROR/UsbObserver(76):     at com.android.server.ServerThread.run(SystemServer.java:402)<br>
03-21 13:07:48.077: ERROR/ThrottleService(76): Could not open GPS configuration file /etc/gps.conf<br>
03-21 13:07:48.128: ERROR/ThrottleService(76): Error reading data file<br>
03-21 13:07:48.606: ERROR/logwrapper(172): executing /system/bin/tc failed: No such file or directory<br>
03-21 13:07:48.687: ERROR/logwrapper(174): executing /system/bin/tc failed: No such file or directory<br>
03-21 13:07:48.756: ERROR/logwrapper(177): executing /system/bin/tc failed: No such file or directory<br>
03-21 13:07:54.707: ERROR/logwrapper(213): executing /system/bin/tc failed: No such file or directory<br>
03-21 13:07:54.737: ERROR/logwrapper(214): executing /system/bin/tc failed: No such file or directory<br>
03-21 13:07:54.767: ERROR/logwrapper(215): executing /system/bin/tc failed: No such file or directory<br>
03-21 18:08:58.619: ERROR/MetadataRetrieverClient(33): failed to extract an album art<br>
03-21 18:09:17.207: ERROR/ThrottleService(76): Error reading data file<br>
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<br>
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!<br>
03-21 18:25:31.837: ERROR/AndroidRuntime(439): FATAL EXCEPTION: main<br>
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<br>
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1622)<br>
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)<br>
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)<br>
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)<br>
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at android.os.Handler.dispatchMessage(Handler.java:99)<br>
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at android.os.Looper.loop(Looper.java:123)<br>
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at android.app.ActivityThread.main(ActivityThread.java:3647)<br>
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at java.lang.reflect.Method.invokeNative(Native Method)<br>
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at java.lang.reflect.Method.invoke(Method.java:507)<br>
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)<br>
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)<br>
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at dalvik.system.NativeStart.main(Native Method)<br>
03-21 18:25:31.837: ERROR/AndroidRuntime(439): Caused by: java.lang.NullPointerException<br>
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at com.example.ssms.MsgSmsActivity2.onCreate(MsgSmsActivity2.java:23)<br>
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)<br>
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1586)<br>
03-21 18:25:31.837: ERROR/AndroidRuntime(439):     ... 11 more
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T20:22:14+00:00Added an answer on May 31, 2026 at 8:22 pm

    arr is an array of Strings.tx.setText(arr); will give exception because setText is defined to accept CharSequence

    If you want to set some text on the TextView, then first get the String from array using arr[index] and then set that String to the textview.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to pass a byte array from inside my rails app into another
I am trying to pass Array from one class to another I used detailViewController.nameArray
I am trying to pass the value of a string from an array to
I'm trying to pass in a Base64 string into a C#.Net web application via
I am trying to pass custom event data from 1 class to another class...here
I'm trying to create an XML string and pass it to another method where
I am trying to pass an array to a ruby script from a command
I am trying to pass a string that already contains quotation marks from one
I'm trying to pass a value from an android spinner selection into a url.
I'm trying I have a string that I pass into my function from user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.