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 7790697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:39:50+00:00 2026-06-01T21:39:50+00:00

I am new to android.I have a response of strings which i need to

  • 0

I am new to android.I have a response of strings which i need to display in spinner.I have sent the response..

04-12 16:15:44.567: I/System.out(9569): Json obj length:: 58
04-12 16:15:44.577: I/System.out(9569): Alabama
04-12 16:15:44.577: I/System.out(9569): Alaska
04-12 16:15:44.577: I/System.out(9569): Alberta
04-12 16:15:44.577: I/System.out(9569): Arizona
04-12 16:15:44.597: I/System.out(9569): Arkansas
04-12 16:15:44.597: I/System.out(9569): British Colombia
04-12 16:15:44.597: I/System.out(9569): California
04-12 16:15:44.597: I/System.out(9569): Colorado
04-12 16:15:44.597: I/System.out(9569): Connecticut
04-12 16:15:44.597: I/System.out(9569): Delaware
04-12 16:15:44.597: I/System.out(9569): District Of Columbia
04-12 16:15:44.597: I/System.out(9569): Florida
04-12 16:15:44.597: I/System.out(9569): Georgia
04-12 16:15:44.597: I/System.out(9569): Hawaii
04-12 16:15:44.597: I/System.out(9569): Idaho
04-12 16:15:44.597: I/System.out(9569): Illinois
04-12 16:15:44.597: I/System.out(9569): Indiana
04-12 16:15:44.607: I/System.out(9569): Iowa
04-12 16:15:44.607: I/System.out(9569): Kansas
04-12 16:15:44.607: I/System.out(9569): Kentucky
04-12 16:15:44.607: I/System.out(9569): London
04-12 16:15:44.607: I/System.out(9569): Louisiana
04-12 16:15:44.607: I/System.out(9569): Maine
04-12 16:15:44.607: I/System.out(9569): Maryland
04-12 16:15:44.607: I/System.out(9569): Massachusetts
04-12 16:15:44.607: I/System.out(9569): Michigan
04-12 16:15:44.607: I/System.out(9569): Minnesota
04-12 16:15:44.618: I/System.out(9569): Mississippi
04-12 16:15:44.618: I/System.out(9569): Missouri
04-12 16:15:44.618: I/System.out(9569): Montana
04-12 16:15:44.618: I/System.out(9569): Nebraska
04-12 16:15:44.618: I/System.out(9569): Nevada
04-12 16:15:44.618: I/System.out(9569): New Hampshire
04-12 16:15:44.618: I/System.out(9569): New Jersey
04-12 16:15:44.618: I/System.out(9569): New Mexico
04-12 16:15:44.618: I/System.out(9569): New York
04-12 16:15:44.618: I/System.out(9569): North Carolina
04-12 16:15:44.628: I/System.out(9569): North Dakota
04-12 16:15:44.628: I/System.out(9569): Ohio
04-12 16:15:44.628: I/System.out(9569): Oklahoma
04-12 16:15:44.628: I/System.out(9569): Ontario
04-12 16:15:44.628: I/System.out(9569): Oregon
04-12 16:15:44.628: I/System.out(9569): Pennsylvania
04-12 16:15:44.628: I/System.out(9569): Puerto Rico
04-12 16:15:44.628: I/System.out(9569): Quebec
04-12 16:15:44.638: I/System.out(9569): Rhode Island
04-12 16:15:44.648: I/System.out(9569): South Carolina
04-12 16:15:44.648: I/System.out(9569): South Dakota
04-12 16:15:44.648: I/System.out(9569): Tennessee
04-12 16:15:44.648: I/System.out(9569): Texas
04-12 16:15:44.648: I/System.out(9569): Utah
04-12 16:15:44.648: I/System.out(9569): Vermont
04-12 16:15:44.648: I/System.out(9569): Virgin Island
04-12 16:15:44.658: I/System.out(9569): Virginia
04-12 16:15:44.658: I/System.out(9569): Washington
04-12 16:15:44.658: I/System.out(9569): West Virginia
04-12 16:15:44.658: I/System.out(9569): Wisconsin
04-12 16:15:44.658: I/System.out(9569): Wyoming

my code is

public  ArrayList<TourScheduleInfo> GetCustomerState(String stateName) {



        SoapObject soap_request = new SoapObject(DataMemeber.NAMESPACE, DataMemeber.CUSTOMER_STATE_METHOD_NAME);


        SoapSerializationEnvelope envelope_order = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        envelope_order.dotNet = true;
        envelope_order.setOutputSoapObject(soap_request);
        HttpTransportSE androidHttpTransports = new HttpTransportSE(DataMemeber.URL);
        try 
        {
            String SOAP_ACT = DataMemeber.NAMESPACE + DataMemeber.CUSTOMER_STATE_METHOD_NAME;
            System.out.println("SOAP_ACT IN OrderNo:: " + SOAP_ACT);

            androidHttpTransports.call(SOAP_ACT, envelope_order);
            Object response = envelope_order.getResponse();
            System.out.println("Input String :: " + envelope_order.bodyOut);
            Log.i("Output: ", response.toString());




           JSONArray jsonobj = new JSONArray(response.toString());
            System.out.println("Json obj length:: " + jsonobj.length());
             for(int i=0; i<jsonobj.length(); i++)
            {
                TourScheduleInfo tourInfo = new TourScheduleInfo();

                JSONObject jobj = jsonobj.getJSONObject(i);
                stateName = jobj.getString("StateName");


                tourInfo.setStateName(stateName);

                System.out.println(stateName);

                StatenameList.add(tourInfo);
                tourInfo.getStateName();

          }

             System.out.println(StatenameList);
        } 
        catch (Exception e) {
            e.printStackTrace();
            System.out.println("Exception :: " + e.toString());
        }

        return StatenameList;
    }

I have to set the spinner values in another class.So i have to get the array values and pass to the spinner in another class.I tried many ways but i didnt get.pls help.

  • 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-06-01T21:39:52+00:00Added an answer on June 1, 2026 at 9:39 pm

    put response string into an array

    ArrayList<String> mArrayList = new ArrayList<String>();
    
            ............
            androidHttpTransports.call(SOAP_ACT, envelope_order);
            Object response = envelope_order.getResponse();
            System.out.println("Input String :: " + envelope_order.bodyOut);
            Log.i("Output: ", response.toString());
    
            mArrayList.add( response.toString());   //here you put your data to array
           .......
    

    And do the following..

    Spinner s = (Spinner) findViewById(R.id.spin);  //Spinner its id is spin
     ArrayAdapter adapter = new ArrayAdapter(this,
     android.R.layout.simple_spinner_item, mArrayList );
     s.setAdapter(adapter);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to android. I have a url which only has the json
I am new to android development. I have created a popup window which is
I have an Android application which needs username and password to login. I need
I have JSON data which contents Strings and Image URLs, and I already parse
I have an android application which downloads its information as JSON. A typical JSON
I need to include JSON in my android app, I have followed some tutorials
hi to all i am new to android i have to send my different
I am a bit new with android but I have some java experience. So
i am creating a new android application.i am using the table layout. I have
Ok, im fairly new to android but i have managed to teach myself the

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.