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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:55:38+00:00 2026-06-01T04:55:38+00:00

I created the Layout design using java code only not from the XML Layout

  • 0

I created the Layout design using java code only not from the XML Layout Designs. The code I used is following

 public View getView(int position, View convertView, ViewGroup parent) {
  TextView tv = new TextView(mContext);
  tv.setText(hotelList.get(position).name);
  return tv;
  }

How to use layoutInflator for creating layout fro this. I need 2 more textviews in a single list item. the whole list contains 10 different list items

Please provide some codes for this. Help appreciated

  • 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-01T04:55:39+00:00Added an answer on June 1, 2026 at 4:55 am

    I have gone through this before by having my static class too. Check this out, it will help:

    @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            View rowView = convertView;
    
    
            if ( rowView == null) {
    
                LayoutInflater inflator = this._activity.getLayoutInflater();
                rowView = inflator.inflate(R.layout.todolistlisting, null);
                TodoListViewHolder viewHolder = new TodoListViewHolder();
                viewHolder._name        = (TextView) rowView.findViewById(R.id.tVTLName);           
                viewHolder._completed   = (TextView) rowView.findViewById(R.id.tVTLCCount);
                viewHolder._remaining   = (TextView) rowView.findViewById(R.id.tVTLRCount);
                rowView.setTag(viewHolder);
    
            }
    
            TodoListViewHolder holder = (TodoListViewHolder) rowView.getTag();
            VO_TodoList votodolist = this._items.get(position);         
            holder._name.setText(votodolist._title);            
            holder._completed.setText(votodolist._completed);
            holder._remaining.setText(votodolist._remaining);
    
            return rowView;     
    
        }
    

    TodoListViewHolder is my view component holder here. like your TextView.

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

Sidebar

Related Questions

I just create the Layout design using java code only not from the XML
I created one Linear layout inside scroll view (Horizontal) in xml with number of
I have created the layout of the website (template). I used Photoshop to design
I've created a dummy layout for my latest design, but when I resize the
I have created a simple layout using the HTML div tag. I would like
I have created the following database layout, and started coding the application. The more
I'm using Drupal 6 and have created 2 equal columns in layout.css In the
I am using ordered list design to to make my twitter app to view
I created layout and layout-land folders, in Manifest i have android:configChanges=keyboardHidden|orientation If i remove
I created this layout of successive text input fields, 1- Enter data into empty

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.