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

  • Home
  • SEARCH
  • 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 6862699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:41:35+00:00 2026-05-27T02:41:35+00:00

I have created a custom list view and created my own adapter class I

  • 0

I have created a custom list view and created my own adapter class
I have inflated the view with below code:

@Override
public View getView(final int position, View convertView, ViewGroup parent) {
    LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View streamrowView = layoutInflater.inflate(R.layout.streamrow, parent,false);
    initUI(streamrowView);

    tvUserMsg.setText(values[position].Message);
    tvPostDate.setText(values[position].postDate);

    return streamrowView;
}



    private void initUI(View streamrowView) {
    tvUserMsg = (TextView) streamrowView.findViewById(R.id.tvUserMsg);
    tvPostDate = (TextView) streamrowView.findViewById(R.id.tvPostDate);

}

List view is working perfectly, but the set onItemClick listener event is not working

    listView.setOnItemClickListener(new OnItemClickListener() {

        public void onItemClick(AdapterView<?> data, View v, int pos,
                long arg3) {

            Toast.makeText(getApplicationContext,  "list clicked" ,1).show();
            System.out.println("*****List clicked!!!");

        }
    });

is there any other approach for onItemClick listener for custom rows.

  • 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-27T02:41:36+00:00Added an answer on May 27, 2026 at 2:41 am
    public View getView(final int position, View convertView,
                    ViewGroup parent) {
                final View vi ;//= convertView;
                ViewHolder holder;
                // if (convertView == null) {
                vi = inflater.inflate(R.layout.row_mbc_language, null);
                holder = new ViewHolder();
                holder.txtViewLangItem = (TextView) vi
                        .findViewById(R.id.txtViewLangItem);
    
                holder.imgViewSelectedLang = (ImageView) vi
                        .findViewById(R.id.imgViewSelectedLang);
    
                vi.setTag(holder);
    
                vi.setOnClickListener(new OnClickListener() {
    
                    @Override
                    public void onClick(View arg0) {
                        // TODO Auto-generated method stub
                        BibleActivity.selectedLangCode = MBCLanguageListAdapter.this.resultsLang[position].languageCode;
                        MainActivity.SavePreferences("langCode",
                                BibleActivity.selectedLangCode,
                                MBCLanguageListAdapter.this.activity);
                        notifyDataSetChanged();
    
                    }
                });
    
                holder.txtViewLangItem.setText(this.resultsLang[position].language);
                if (this.resultsLang[position].languageCode
                        .equals(BibleActivity.selectedLangCode)) {
                    holder.imgViewSelectedLang.setVisibility(View.VISIBLE);
                }
    
                return vi;
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a custom Base Adapter class, to populate a list view with
We have created custom listview by using the Base adapter. List view contains Text
I have created my own custom ValidationAttribute : public class UrlValidationAttribute : ValidationAttribute {
i have created a custom dialog class public class NewPost extends Dialog { //
I have created a list using Custom List in Data Sheet View . After
I have created a custom list view . In each listitem i have a
i have created a My custom listActivty by extending ListActivity like this. public class
I have created a custom list as a feature in sharepoint. i need to
friends, i have created custom title bar using following titlebar.xml file with code <?xml
I have created a Custom Edit Form for a custom list using SharePoint designer.

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.