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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:50:30+00:00 2026-05-27T21:50:30+00:00

i parsed my xml file successfully using sax parser.my doubt is how to convert

  • 0

i parsed my xml file successfully using sax parser.my doubt is how to convert string to file path. i have 3 spinner the 1st spinner show my parent node string value and 2nd spinner show child node name tag value and 3rd spinner show path tag value. this is my xml file link pls see this link = http://paste.org/42924

I hope you are clear now I am trying to convert my path tag string value to sdcard file path. I stored my path tag string value in path_List array list. Now I got all path string value in this array list. how to convert this sting value to file path? I wish to show images in same screen bottom in grid view format that’s all. now I stored the path tag string value in my array list the array list name is path_List. how to convert convert my file path?

this is my source code:

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

    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;

    @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);
        spinner_path =(Spinner) findViewById(R.id.spinner3);

        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("neevee.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);
            }

            adapter_hltag = new ArrayAdapter<String>(ParxmlActivity.this,android.R.layout.simple_spinner_item, hltag_List); 
            spinner_hltag.setAdapter(adapter_hltag);


            adapter_sltag = new ArrayAdapter<String>(ParxmlActivity.this,android.R.layout.simple_spinner_item, name_List); 
            spinner_sltag.setAdapter(adapter_sltag); 


            adapter_path = new ArrayAdapter<String>(ParxmlActivity.this,android.R.layout.simple_spinner_item, path_List); 
            spinner_path.setAdapter(adapter_path);

        } catch (Exception e) { 

        }
    }
}
  • 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-27T21:50:30+00:00Added an answer on May 27, 2026 at 9:50 pm
     GridView sdcardImages = (GridView) findViewById(R.id.sdcard);
     sdcardImages.setAdapter(new ImageAdapter(this));
    

    //Create a new class called ImageAdapter that extends BaseAdapter:

    public class ImageAdapter extends BaseAdapter {
        private Context mContext;
    
        public ImageAdapter(Context c) {
            mContext = c;
        }
    
        public int getCount() {
            return path_List.length;
        }
    
        public Object getItem(int position) {
                return null;
        }
    
        public long getItemId(int position) {
            return 0;
        }
    

    // create a new ImageView for each item referenced by the Adapter

    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;
            }
    for (int i=0;i<path_List.size();i++){
    Bitmap bitmap = BitmapFactory.decodeFile(path_List);
    
            imageView.setImageBitmap(bitmap);
            return imageView;
    }
    
    
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I have one xml file successfully parsed my before. now i am change
I have parsed XML file into objects, in which each object has a 1:1
I have an XML file which XML parser choke on. A part of it
I'm able to successfully parse the contents of a XML file using TouchXML, but
I've succesfully loaded and parsed this XML file, using XMLParser and AS2: <Resources> <item
I parsed my xml file successfully, but now I am getting null value. so
Where does one access the data from a parsed xml file when using libxml?
I have created this main XML file in my project. I have parsed XML
I am attempting to parse a XML file using Javascript and I'm running into
I am using ElementTree to parse a XML file. In some fields, there will

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.