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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:34:05+00:00 2026-06-05T12:34:05+00:00

Am having a custom Gridview to display a list of operators with their icon

  • 0

Am having a custom Gridview to display a list of operators with their icon and names of the provider.my problem is the Gridview displaying only Limited providers (12 only).But am having more than 16 values to display.the Remaining Values is getting Repeated in Gridview while Scrolling GridView.

my source code is Here

public class ImageAdapter extends BaseAdapter {

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

    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) {
        View v;
        ImageView imageView;
        if (convertView == null) {
            LayoutInflater layoutInflater = getLayoutInflater();
            v = layoutInflater.inflate(R.layout.icon_with_text, null);
            TextView txt = (TextView) v.findViewById(R.id.icon_text);
            txt.invalidate();
            txt.setTypeface(localTypeface1);
            Collections.sort(providerlist1);
            Log.v("COLLECTIONS", ""+providerlist1);
            txt.setText("" + providerlist1.toArray()[position]);
            String string = (String) txt.getText();
            icon = string.toLowerCase();
            System.out.println(icon);
            int resid = getResources().getIdentifier("" + icon, "drawable",
                    "com.digient.yeldi.app");
            imageView = (ImageView) v.findViewById(R.id.icon_image);
            imageView.setImageResource(resid);

        } else {
            v = convertView;
        }

        return v;

    }

}

providerlist1 is an arraylist in which am having more than 16 operators values.

  • 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-05T12:34:07+00:00Added an answer on June 5, 2026 at 12:34 pm

    Use Below Code for that, may be it will help you.

    public class ImageAdapter extends BaseAdapter {
    
        LayoutInflater layoutInflater;
        Context ctx;
        public ImageAdapter(Context context) {
            // TODO Auto-generated constructor stub
            layoutInflater=LayoutInflater.from(context);
            this.ctx=context;
        }
    
        public int getCount() {
            return providerlist1.size();
        }
    
        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) {
            View v;
            ImageView imageView;
            if (convertView == null) {
                v = layoutInflater.inflate(R.layout.icon_with_text, null);
            } else {
                v = convertView;
            }
    
            TextView txt = (TextView) v.findViewById(R.id.icon_text);
            txt.invalidate();
            txt.setTypeface(localTypeface1);
            Collections.sort(providerlist1);
            Log.v("COLLECTIONS", ""+providerlist1);
            txt.setText("" + providerlist1.toArray()[position]);
            String string = (String) txt.getText();
            icon = string.toLowerCase();
            System.out.println(icon);
            int resid = getResources().getIdentifier("" + icon, "drawable", "com.digient.yeldi.app");
            imageView = (ImageView) v.findViewById(R.id.icon_image);
            imageView.setImageResource(resid);
    
            return v;
    
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having a bit of trouble using the List.Find with a custom predicate i have
I am having problem with previewing custom performance counters with PerflibV2. Performance Monitor shows
I'm having trouble figuring out how to bind a custom IList to a gridview.
Problem occurs when I try to reuse views in ListView having several custom layouts.
I have problem sorting my Gridview using my custom entity classes My complex entity
I am creating a list view with each row having custom layout. Each custom
I have a listview with custom row having a textview and a clickable image
Having searched for a way to enforce immutability of custom types and not having
I have been having trouble pulling up a custom UIPickerView from the textfield's inputview
I'm having trouble loading a custom font. .m file: - (void)viewDidLoad { [label setFont:[UIFont

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.