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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:10:26+00:00 2026-05-28T17:10:26+00:00

Hi I have created one fully xml based project. my doubts now I store

  • 0

Hi I have created one fully xml based project. my doubts now I store all xml value in my array list. The array list name is mspec_List. how to parse this array list value? I got all values using sax parser. my 1st activity display some images if i click that images i want to show some paragraph in my next activity screen that paragraph are stored in my array list. how to show that paragraph in my next activity? I have created new class and i am using an textview, also i wish to show that array list value in that textview. please help me….`

i am trying to parse that arraylist value but it’s not working see the below code.

    sdcardImages.setOnItemClickListener(new OnItemClickListener() {


        public void onItemClick(AdapterView parent, View v, int position, long id) {
            Intent intent = new Intent(ParxmlActivity.this, tabview.class);
            intent.putStringArrayListExtra("numbers", mspec_List);
            //intent.putExtra("name",model_List.get(position).name);


            startActivity(intent);  

        }
    });

full source code:

  package ml.ml;

    import java.io.IOException; 
    import java.io.InputStream;
    import java.util.ArrayList;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.InputSource;
    import org.xml.sax.XMLReader;
    import android.app.Activity;
    import android.content.Context;
    import android.content.Intent;
    import android.content.res.AssetManager;
    import android.database.Cursor;
    import android.graphics.Bitmap;
    import android.graphics.BitmapFactory;
    import android.graphics.drawable.Drawable;
    import android.net.Uri;
    import android.os.Bundle;
    import android.os.Environment;
    import android.provider.MediaStore;
    import android.util.Log;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.ViewGroup;
    import android.view.View.OnClickListener;
    import android.widget.AdapterView;
    import android.widget.ArrayAdapter;
    import android.widget.BaseAdapter;
    import android.widget.Button;
    import android.widget.GridView;
    import android.widget.ImageView;
    import android.widget.LinearLayout;
    import android.widget.Spinner;
    import android.widget.TextView;
    import android.widget.AdapterView.OnItemClickListener;

    public class ParxmlActivity extends Activity {

        private String array_spinner[];
        private Cursor cursor;
        private int columnIndex;

        ParsedExampleDataSet parsedExampleDataSet= null;

        ArrayList<String> hltag_List=new ArrayList<String>();
        ArrayList<Subchild>sltag_List=new ArrayList<Subchild>();

        ArrayList<String> name_List =new ArrayList<String>();
        ArrayList<String> path_List =new ArrayList<String>();
        ArrayList<String> mmimage_List = new ArrayList<String>();
        ArrayList<String> mname_List = new ArrayList<String>();
        ArrayList<String> mmimage = new ArrayList<String>();
        ArrayList<String> mvideo_List = new ArrayList<String>();
        ArrayList<schild> model_List =new ArrayList<schild>();
        ArrayList<String> mspec_List = new ArrayList<String>();

        Spinner spinner_hltag,spinner_sltag, spinner_path;

        ArrayAdapter<String> adapter_hltag;
        ArrayAdapter<String> adapter_sltag;
        ArrayAdapter<String> adapter_path;

        int hltagPos=0;
        int sltagPos=0;


        Object sdcard;

        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);

            GridView sdcardImages = (GridView) findViewById(R.id.sdcard);
            spinner_hltag= (Spinner) findViewById(R.id.spinner1);
            spinner_sltag = (Spinner) findViewById(R.id.spinner2);

            sdcardImages.setOnItemClickListener(new OnItemClickListener() {


                public void onItemClick(AdapterView parent, View v, int position, long id) {
                    Intent intent = new Intent(ParxmlActivity.this, tabview.class);
                    intent.putStringArrayListExtra("numbers", mspec_List);
                    //intent.putExtra("name",model_List.get(position).name);


                    startActivity(intent);  

                }
            });

            sdcardImages.setAdapter(new ImageAdapter(this));

            String[] proj = {MediaStore.Images.Thumbnails._ID};

            cursor = managedQuery(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
                    proj, null, null, null);


            columnIndex = cursor.getColumnIndexOrThrow(MediaStore.Images.Thumbnails._ID);



            try {
                /* Get a SAXParser from the SAXPArserFactory. */
                SAXParserFactory spf = SAXParserFactory.newInstance();
                SAXParser sp = spf.newSAXParser();

                /* Get the XMLReader of the SAXParser we created. */
                XMLReader xr = sp.getXMLReader();

                /* Create a new ContentHandler and apply it to the XML-Reader */
                ExampleHandler myExampleHandler = new ExampleHandler();
                xr.setContentHandler(myExampleHandler);

                /* Parse the xml-data from our file. */
                xr.parse(new InputSource(getAssets().open("mafile.xml")));
                /* Parsing has finished. */

                parsedExampleDataSet =myExampleHandler. myParsedExampleDataSet;

                for (int i = 0; i < parsedExampleDataSet.gethltag().size(); i++) {
                    Log.v("gethltag SIZE ", ""+parsedExampleDataSet.gethltag().size());
                    hltag_List.add(parsedExampleDataSet.getHLTag().get(i));

                }

                sltag_List = parsedExampleDataSet.getSLTag(hltag_List.get(hltagPos));


                for(int i = 0; i < sltag_List.size(); i++) {
                    name_List.add(sltag_List.get(i).name);
                    path_List.add(sltag_List.get(i).path);



                }
                    model_List.clear();     
                    model_List = sltag_List.get(sltagPos).model;

                    for(int j = 0; j<model_List.size(); j++){
                        mmimage_List.addAll(model_List.get(j).imageList);
                        mname_List.add(model_List.get(j).name);
                        mvideo_List.addAll(model_List.get(j).videoList);
                        mmimage.add(model_List.get(j).mimage);
                        mspec_List.add(model_List.get(j).spec);

                    }



                spinner_hltag.setAdapter(new MyAdapter(ParxmlActivity.this, R.layout.row, hltag_List)); 


                spinner_sltag.setAdapter(new MyAdapter1(ParxmlActivity.this, R.layout.row1,name_List)); 




            } catch (Exception e) { 

            }


        }


        private class ImageAdapter extends BaseAdapter {

            private Context mContext;
            //ArrayList<String> path_List =new ArrayList<String>();

            public ImageAdapter(Context c) {
                mContext = c;
            }

            public int getCount() {
                return path_List.size();
            }

            public Object getItem(int position) {
                return null;
            }

            public long getItemId(int position) {
                return 0;
            }
            public View getView(int position, View convertView, ViewGroup parent) {
                ImageView imageView;
                if (convertView == null) {  // if it's not recycled, initialize some attributes
                    imageView = new ImageView(mContext);
                    imageView.setLayoutParams(new GridView.LayoutParams(85, 85));
                    imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
                    imageView.setPadding(8, 8, 8, 8);
                } else {
                    imageView = (ImageView) convertView;
                }

                //Bitmap bitmap = BitmapFactory.decodeFile(path_List);
                Bitmap bitmap = BitmapFactory.decodeFile(path_List.get(position));
                imageView.setImageBitmap(bitmap);
                return imageView;

            }



        }
        public class MyAdapter extends ArrayAdapter<String>{


            public MyAdapter(Context context, int textViewResourceId,   ArrayList<String> hltagList) {
                super(context, textViewResourceId, hltagList);
            }



            @Override
            public View getDropDownView(int position, View convertView,ViewGroup parent) {
                return getCustomView(position, convertView, parent);
            }

            @Override
            public View getView(int position, View convertView, ViewGroup parent) {
                return getCustomView(position, convertView, parent);
            }

            public View getCustomView(int position, View convertView, ViewGroup parent) {

                LayoutInflater inflater=getLayoutInflater();
                View row=inflater.inflate(R.layout.row, parent, false);

                TextView label=(TextView)row.findViewById(R.id.weekofday);
                label.setText(hltag_List.get(position));



                ImageView icon=(ImageView)row.findViewById(R.id.icon);

                Bitmap bitmap = BitmapFactory.decodeFile(path_List.get(position));;
                icon.setImageBitmap(bitmap);

                return row;
            }
        }

        public class MyAdapter1 extends ArrayAdapter<String>{


            public MyAdapter1(Context context, int textViewResourceId,   ArrayList<String> name_List) {
                super(context, textViewResourceId, name_List);
            }



            @Override
            public View getDropDownView(int position, View convertView,ViewGroup parent) {
                return getCustomView(position, convertView, parent);
            }

            @Override
            public View getView(int position, View convertView, ViewGroup parent) {
                return getCustomView(position, convertView, parent);
            }

            public View getCustomView(int position, View convertView, ViewGroup parent) {

                LayoutInflater inflater=getLayoutInflater();
                View row=inflater.inflate(R.layout.row, parent, false);

                TextView sub=(TextView)row.findViewById(R.id.weekofday1);
                sub.setText(name_List.get(position));

                ImageView icon=(ImageView)row.findViewById(R.id.icon);

                Bitmap bitmap = BitmapFactory.decodeFile(path_List.get(position));;
                icon.setImageBitmap(bitmap);

                return row;
            }
        }

    }

`

  • 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-28T17:10:27+00:00Added an answer on May 28, 2026 at 5:10 pm

    If you are having String ArrayList you can simply pass it using intent.putStringArrayListExtra(name, value). For more you can check my answer here.

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

Sidebar

Related Questions

I have created a new method in one of the project's controllers that it
I have created one table using the below command: create table Table1( Id int
I have created one aspx Page from that i need to access the property
I have created one application in flex that is accessing the Java webservice using
I have created one user named tuser with create database rights in SQL server
hello i have created one windows application in c# .net and its working fine
I have created a one-time subscription in SSRS report manager 2008. However I keep
I have created two JavaScript files. One file is "validators.js" and the other is
I have created a .NET DLL which makes some methods COM visible. One method
I have created an interface using jQuery UI Tabs, however one of my requirements

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.