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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:33:30+00:00 2026-05-28T13:33:30+00:00

hi I am trying to get my arraylist value into my image adapter class

  • 0

hi I am trying to get my arraylist value into my image adapter class but i got error now. i am trying to solve but i don’t know.

error line:

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

error : The method get(String) in the type Bundle is not applicable for the arguments (int)

my code:
parxmlActivity.java class

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);
                //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) { 

        }


    }


    }

this is my ImageAdapter.class i got error in below code:

public class ImageAdapter extends BaseAdapter {

    Bundle path_List;
    private Context mContext;

    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;

    }



}
  • 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-28T13:33:31+00:00Added an answer on May 28, 2026 at 1:33 pm

    You are trying to get string values from Bundle path_List instead of ArrayList<String> path_List that’s why you got this error..

    Remove this line Bundle path_List; from public class ImageAdapter extends BaseAdapter

    Make a reference to ArrayList<String> path_List not to Bundle path_List

    And try to run again..

    UPDATE: Also I am assuming your ImageAdapter class in ParxmlActivity..

    Code: Also if possible make changes in your ImageAdapter class.. something like,

        public class ImageAdapter extends BaseAdapter
    {
        ArrayList<String> path_List =new ArrayList<String>();
        Activity activity;
    
    public ImageAdapter(Activity activity,ArrayList<String> path_List)
        {
            this.activity = activity;
            this.path_List = path_List;
        }
     ....
    

    And in your activity this line should be,

     sdcardImages.setAdapter(new ImageAdapter(this,path_List));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get my sltag value but I got some errors in
Hi I am trying to pass my ArrayList value into my TabLayout but I
I am trying to get a value from with in an ArrayList. Here is
I am trying to get a value from with in an ArrayList . I
i am trying to use session but i get error: The name 'Session' does
Trying to get an ASP application deployed; it worked for a while but then
Trying to get a value out of 2d array inside of a hash and
I am now trying to add a simple PE into my app. This PE
What I'm trying to do here is to always get a random value from
I'm trying to convert Bradley Copers awesome grouped ComboxBox into a GroupedCheckedListBox. But in

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.