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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:51:33+00:00 2026-06-10T09:51:33+00:00

I got this app that records the user’s Facebook ID in a MySQL table,

  • 0

I got this app that records the user’s Facebook ID in a MySQL table, and now I’m trying to get this ID and show the user’s profile picture on a ListView, but I don’t know what I’m doing wrong.

My custom ArrayAdapter:

public class VisualAdapter extends ArrayAdapter<String> {

private final Context contexto;

private final String[] comics, username, userid;

URL img_url = null;

Bitmap bm;

public VisualAdapter(Context contexto, String[] comics, String[] username, 
        String[] userid) {
    super(contexto, R.layout.exibeimg, comics);
    this.contexto = contexto;
    this.comics = comics;
    this.username = username;
    this.userid = userid;
}

public View getView(int position, View convertView, ViewGroup parent) {
    // TODO Auto-generated method stub
    LayoutInflater inflater = (LayoutInflater) contexto
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    View rowView = inflater.inflate(R.layout.exibeimg, parent, false);
    TextView textView = (TextView) rowView.findViewById(R.id.tvTitleImage);
    ImageView imageView = (ImageView) rowView.findViewById(R.id.ivImageVisual);
    ImageView ivUser = (ImageView) rowView.findViewById(R.id.ivUser);
    TextView tvUser = (TextView) rowView.findViewById(R.id.tvUserNAME);
    textView.setText(comics[position]);
    tvUser.setText(username[position]);

    try {
        img_url = new URL("http://graph.facebook.com/"+userid+"/picture?type=thumbnail");
        bm = BitmapFactory.decodeStream(img_url.openConnection().getInputStream());
        ivUser.setImageBitmap(bm);
    }
    catch (Exception e) {
        e.printStackTrace();
    }
    return rowView;
}

}

Logcat: http://pastebin.com/kmLXKvZJ

Also, this is inside a tab. It’s in Tab 2, and when the app starts at Tab 1 when I click in Tab 2 (to see this list), it takes a few seconds to load, is there something that I can do to load it faster?

  • 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-10T09:51:35+00:00Added an answer on June 10, 2026 at 9:51 am

    It is taking a few seconds to load because you are performing a network operation synchronously inside getView(), which blocks the main UI thread from rendering the view every single time when it is waiting for a network response. This is very bad and what you need to do is to do an asynchronous lazy loading of images so that downloading the pictures is not performed on the UI thread.

    Read this great article on how to implement ListView correctly so that it does not take a few seconds to load.

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

Sidebar

Related Questions

I have an app that records some data (time, user’s gps position etc). Now
I have a database connection that I got like this: db = Mongo::Connection.new.db(app-development) but
I've got a control in my app that records audio and saves it. I
I have a console app that will choose records based on if the user
I've got a model in a simple django app that records a score for
In my app I have one DB table with that structure: user TEXT |
I am trying to do a function in my app that records the sound
We've got a database that generally has this structure: Master Record Table id (pk)
I got this app that needs to be updated with a new database. I
I've got a very simple app where the flow looks like this: User reads

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.