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

  • Home
  • SEARCH
  • 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 8305163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:01:21+00:00 2026-06-08T18:01:21+00:00

I have to parse data from server to spinner. Now I want to delete

  • 0

I have to parse data from server to spinner. Now I want to delete some value from Spinner .

Here is my code .

mytaxList include all values. Now I want put check that if TaxType is compound delete TaxName and TaxValue of that type from spinner. Actually i donot want to display cound type tax in spinner. i.e i want to remove compound type tax from ArrayList mytaxList.

JSONObject taxes = returnTaxlist.getJSONObject(TAG_TAXES);

        Object tax ;

         if (taxes.optJSONArray("tax") != null){
                //The result isn't null so it is a JSONArray
                tax = taxes.optJSONArray("tax");
                }
                else
                {
                //The result is null so it isn't a JSONArray
                tax = taxes.optJSONObject("tax");
                }

                if (tax instanceof JSONObject){
                // The object is a JSONObject
                    tax =  taxes.getJSONObject(TAG_TAX);
                }

                    else
                     {
                // The object is a JSONArray

                    tax = taxes.getJSONArray(TAG_TAX);

                    mytaxList = new ArrayList<TaxList>();


                    for(int i = 0; i <=((JSONArray)tax).length(); i++)
                         {
                        if(i==0){
                            TaxList iTaxClass = new TaxList();
                             iTaxClass.setTaxId("");
                             iTaxClass.setTaxName("--Select--");
                             iTaxClass.setTaxType("");
                             iTaxClass.setTaxvalue("");
                             mytaxList.add(iTaxClass);

                             continue;

                        }

                          JSONObject taxlist = ((JSONArray)tax).getJSONObject(i-1);
                          TaxList iTaxClass = new TaxList();

                               //***** Storing each JSON item in variable
                         iTaxClass.setTaxId(taxlist.getString(TAG_TAX_ID));
                         iTaxClass.setTaxName(taxlist.getString(TAG_TAX_NAME));
                         iTaxClass.setTaxType(taxlist.getString(TAG_TAX_TYPE));
                         iTaxClass.setTaxvalue(taxlist.getString(TAG_TAX_VALUE));

                         mytaxList.add(iTaxClass);


                         } 

                            tax1 = (Spinner)findViewById(R.id.item1);
                            tax1.setAdapter(new TaxListAdapter(mytaxList,this));

                            tax1.setOnItemSelectedListener(new Spinner.OnItemSelectedListener() {

                             public void onItemSelected(AdapterView<?> parent, View selectedItemView, int position, long id) 
                             {

                                    TaxListAdapter taxlistvalue = (TaxListAdapter)parent.getAdapter();
                                    taxlistvalue.getItemId(position);

                        }

                        public void onNothingSelected(AdapterView<?> arg0) {


                        }
                    });
  • 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-08T18:01:22+00:00Added an answer on June 8, 2026 at 6:01 pm

    Before adding into ArrayList check this condition for Custom tax object, if it has add object into arraylist else no need to add.

    if( taxlist.getString(TAG_TAX_NAME).equals("Normal") mytaxList.add(iTaxClass);
        mytaxList.add(iTaxClass);   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use this bit of code to feed some data i have parsed from
I have created a sample query in sql server to parse data from xml
i have data that i fetch from an email server i want to eliminate
I have a ReSTful web service which needs to parse locale-sensitive data from the
I have a function that will parse some data coming in. My problem is
Hi I have this code to parse JSON on JQUERY var json_text2 = $.parseJSON('{data:[[1340650436,2.00000],[1340736844,4.00000]],label:Waist
I have to send an XML request to recover data from a remote server
I have a few NSManagedObject classes. I am pulling down some JSON data from
In my iPhone application I get json data from a remote server, parse it
I am retrieving some data from the server which looks something like this: 1:some

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.