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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:48:34+00:00 2026-05-26T23:48:34+00:00

I have an activity with listview and attached footer. I created my custom adapter

  • 0

I have an activity with listview and attached footer. I created my custom adapter for filling ListView. After I filled it I need to do some actions.
This is my activity’s code part:

public class MainActivity extends ListActivity {

final public String NO_USERS_IN_DB = "No users yet, please add some...";
DBAdapter db = new DBAdapter(this);
Activity activity = MainActivity.this;
private static final Pattern PATTERN = Pattern.compile(": *([^|]+)");
private static final int REQUEST_LOAD = 0;
boolean rewrite;
boolean userSelected = false;
final public int REQUEST_SAVE = 1;
boolean showAvatars;
boolean settingsGot = false;
int backgroundColor;
int titleColor;
int buttonBackgroundColor;
int buttonTextColor;

public class MyCustomAdapter extends ArrayAdapter<String> {

    public MyCustomAdapter(Context context, int textViewResourceId,
            String[] objects) {
        super(context, textViewResourceId, objects);

    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        //return super.getView(position, convertView, parent);
        if(!settingsGot){
            getSettings();
            settingsGot = true;
        }
        String[] users = getUsers();
        LayoutInflater inflater=getLayoutInflater();
        View row=inflater.inflate(R.layout.main, parent, false);    
        TextView label=(TextView)row.findViewById(R.id.label);
        label.setText(users[position]);
        if(showAvatars){
            ImageView icon=(ImageView)row.findViewById(R.id.icon);
            byte[] bb = getAvatar(users[position]);
            if(bb != null && bb.length != 0){
                icon.setImageBitmap(BitmapFactory.decodeByteArray(bb, 0, bb.length));
                icon.setVisibility(View.VISIBLE);
            }
        }
        return row;
    }

}

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    db.open();
    String[] users = db.getUsersList();
    boolean showList = true;
    if (users[0].equals("NOUSERSINTHEBASE")){
        users[0] = NO_USERS_IN_DB;
    }
    if (showList){
    View footer = getLayoutInflater().inflate(R.layout.footer, null);
    ListView listView = getListView();
    listView.addFooterView(footer);
    this.setListAdapter(new MyCustomAdapter(this,
            R.layout.main, users));
    }else{
        setContentView(R.layout.footer);
    }
    db.close();
}

So, method I need to do some actions after method getView done its work. Where should I place my doSomeMoreActionsAfterGetView() ?

  • 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-26T23:48:35+00:00Added an answer on May 26, 2026 at 11:48 pm

    After setListAdapter you can change it…

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

Sidebar

Related Questions

I have one SubjectTabActivity and i need to show listview on this activity. But
I am trying to display ListView . I have created one activity , in
I have a ListView in my activity. Each row includes three TextViews in this
I have an activity with a ListView which is populated through a custom ArrayAdapter.
I have an activity with a listView, which uses a custom row layout defined
I have an activity with a listview in it. I implemented a custom list
I have created an Activity that shows a listview and on swipe action another
I have 2 activities: Activity A - Listview/Adapter Activity B - Radio In activity
I have an activity which have ListView. When I want to access this ListView
In my application, i have activity group in which i have a custom ListView

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.