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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:00:18+00:00 2026-05-25T16:00:18+00:00

Hi my problem is simple : imageviews are not fixed. I saw an answer

  • 0

Hi my problem is simple : imageviews are not fixed. I saw an answer in this link : link and i do understand the answer but i can’t do it. So my question is : How do i turn off view recycling in my Adapter ?

If you want i can put a little bit of code :

public class PortfolioAdapter extends ArrayAdapter<PortfolioView>{
private ArrayList<PortfolioView> items;
public PortfolioAdapter(Context context, int textViewResourceId, ArrayList<PortfolioView> items) {
    super(context, textViewResourceId, items);
    this.items = items;
}
public View getView(int position, View convertView, ViewGroup parent) {
    View v = convertView;
    if (v == null) {
        LayoutInflater vi = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        v = vi.inflate(R.layout.portfolio_rows, null);
    }
    PortfolioView pv = items.get(position);
    if (pv != null) {
            TextView ticker = (TextView) v.findViewById(R.id.portfolio_rows_ticker);
            TextView location = (TextView)v.findViewById(R.id.portfolio_rows_location);
            TextView country = (TextView)v.findViewById(R.id.portfolio_rows_country);
            TextView portfolio_value = (TextView)v.findViewById(R.id.portfolio_rows_portfolio_value);
            TextView yesterday_earnings = (TextView)v.findViewById(R.id.portfolio_rows_yesterday_earnings);
            TextView shares = (TextView)v.findViewById(R.id.portfolio_rows_shares);
            TextView last_buy_shares = (TextView)v.findViewById(R.id.portfolio_rows_last_buy_shares);
            TextView last_buy = (TextView)v.findViewById(R.id.portfolio_rows_last_buy);
            TextView your_shares_held = (TextView)v.findViewById(R.id.portfolio_rows_your_shares_held);
            ImageView SmPortrait = (ImageView)v.findViewById(R.id.portfolio_rows_sm_portrait);
            if (ticker != null) {
                  ticker.setText(pv.getPortfolio_ticker()); 
            }
            if (location != null) {
                location.setText(pv.getLocation()); 
            }
            if (country != null) {
                country.setText(pv.getCountry()); 
            }
            if (portfolio_value != null) {
                DecimalFormat f_portfolio_value = new DecimalFormat();
                f_portfolio_value.setMaximumFractionDigits(2);
                String portfolio_value_format = f_portfolio_value.format(pv.getPortfolio_value());

                portfolio_value.setText(portfolio_value_format); 
            }
            if (yesterday_earnings != null) {
                DecimalFormat f_yesterday_earnings = new DecimalFormat();
                f_yesterday_earnings.setMaximumFractionDigits(2);
                String yesterday_earnings_format = f_yesterday_earnings.format(pv.getYesterday_earnings());

                yesterday_earnings.setText(yesterday_earnings_format); 
            }
            if (shares != null) {
                shares.setText(Integer.toString(pv.getShares())); 
            }
            if (last_buy_shares != null) {
                last_buy_shares.setText(Integer.toString(pv.getLast_buy_shares())); 
            }
            if (last_buy != null) {
                last_buy.setText(pv.getLast_buy()); 
            }
            if (your_shares_held != null) {
                your_shares_held.setText(Integer.toString(pv.getYour_shares_held())); 
            }
            if(SmPortrait != null){
                createimage(SmPortrait, pv.getSm_portrait());
            }

    }
    return v;
}
private class CreateImage extends AsyncTask<String, Void, Drawable> {
    ImageView image;
    public CreateImage(ImageView img) {
        image = img;
        image.invalidate();
    }
    protected void onPreExecute() {
    }

    protected Drawable doInBackground(String... urls) {
        InputStream is;
        Drawable d = null ;
        try {
            is = (InputStream)new URL(urls[0]).getContent();
            d = Drawable.createFromStream(is, "Image");
            return d;
        } catch (MalformedURLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return d;
    }
    protected void onPostExecute(Drawable d) {
        image.setBackgroundDrawable(d);
        image.invalidateDrawable(d);

    }
}
// Catch portrait
public void createimage(ImageView img, String url){
    new CreateImage(img).execute(url);
}

}

  • 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-25T16:00:19+00:00Added an answer on May 25, 2026 at 4:00 pm

    The basic idea is that when you setup your view you want to add a thumbnail as a placeholder. Then use the Tag property to “mark” the view with something like the ID from the database – this can then be used to identify which row should be getting the image and you shouldn’t suffer from shifting rows anymore.

    Take a look at the answer to this question by Fedor: link – it provides you with a very good example.

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

Sidebar

Related Questions

This question may look to be very simple but i don't know the answer.
simple problem with a simple question. I have a string, in C# i can
Problem is simple the tab control shows in design mode but is not getting
Simple problem that I can't figure out... How can I print a '%' character
The problem is simple, but I'm struggling a bit already. Server server = new
a possibly simple problem, but weird why I have no idea how to do
I tried solving my problem using this link update - I figured out that
Really simple problem: I want to split a connection string into its keyword /
Simple problem (I think): I want to be able to invoke a click method
The problem is simple: Using bash, I want to add a directory to my

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.