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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:47:30+00:00 2026-06-11T16:47:30+00:00

I am trying to display a list for this I used one class Ios.java

  • 0

I am trying to display a list for this I used one class Ios.java

public class Ios extends Activity implements OnItemClickListener,OnClickListener


        {
        list=(ListView) findViewById(R.id.list);
        list.setOnItemClickListener(this);
        String DATA[] = {"io1","io2","io3","io4","io5"};
        IosListAdapter obj = new IosListAdapter(this.getApplicationContext()
                ,R.layout.row, DATA);
        list.setAdapter(obj);
    }


    @Override
    public void onClick(View v) {
        // TODO Auto-generated method stub

    }


    @Override
    public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
        // TODO Auto-generated method stub

    }}

My custom adapter is below:

public IosListAdapter(Context con, int rid,String[] dATA) {
        // TODO Auto-generated constructor stub
        this.con = con;
        this.DATA = dATA;
        this.rid = rid;
    }


    @Override
    public int getCount() {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public Object getItem(int position) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public long getItemId(int position) {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        // TODO Auto-generated method stub
        LayoutInflater loi = LayoutInflater.from(con);          
        View v = loi.inflate(rid, parent, false);   
        ImageView iv= (ImageView) v.findViewById(R.id.t1);
        TextView tv1 = (TextView) v.findViewById(R.id.t4);
        iv.setBackgroundResource(arrow);
        tv1.setText(DATA[position]);
        return v;
    }}

and demolist.xml::

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="fill_parent"
    android:layout_height="fill_parent" android:background="#f1eff0">


    <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:stretchColumns="1" android:gravity="center_vertical"
        android:background="@drawable/toptab" android:id="@+id/tb1">

        <TableRow>

            <Button android:id="@+id/btnback" android:background="@color/hover_bckbtn"
                android:text="Back" android:textColor="#ffffff" android:textSize="14sp"
                android:textStyle="normal" android:typeface="normal"
                android:layout_marginLeft="5dp" />


            <TextView android:id="@+id/tvnormalcallreg" android:text="Call Registration"
                android:textColor="#ffffff" android:textSize="18sp"
                android:layout_gravity="center" android:textStyle="normal"
                android:typeface="normal" />

            <Button android:id="@+id/btnregister" android:textColor="#ffffff"
                android:background="@color/hover_button" android:text="Register"
                android:textSize="14sp" android:textStyle="normal" android:typeface="normal"
                android:layout_marginRight="5dp" />
        </TableRow>
    </TableLayout>


    <TableLayout android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:stretchColumns="0"
        android:layout_marginRight="30dp">

        <TableRow android:gravity="center_vertical"
            android:layout_width="fill_parent">

            <LinearLayout android:layout_width="wrap_content"
                android:layout_height="wrap_content" android:orientation="vertical">

                <TextView android:id="@+id/top" android:layout_height="wrap_content"
                    android:textStyle="bold" android:layout_width="wrap_content"
                    android:singleLine="true" android:textColor="#ffffff"
                    android:typeface="normal" />

                <TextView android:id="@+id/address" android:layout_width="wrap_content"
                    android:layout_height="wrap_content" android:textSize="10sp"
                    android:textColor="#ffffff" android:typeface="normal"
                    android:layout_marginTop="-2dp" />

                <TextView android:id="@+id/tvdept" android:layout_width="wrap_content"
                    android:layout_height="wrap_content" android:textSize="10sp"
                    android:textColor="#ffffff" android:typeface="normal"
                    android:layout_marginTop="-2dp" />

            </LinearLayout>


        </TableRow>

    </TableLayout>



    <ListView android:id="@+id/list" 
        android:layout_below="@+id/toptbl"  
        android:layout_height="wrap_content"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp" 
        android:layout_width="fill_parent" 
        android:cacheColorHint="#00000000"
        android:fadingEdge="none"
        android:layout_marginBottom="50dp"/>

    <TableLayout android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:layout_alignParentBottom="true"
        android:id="@+id/bottom">

        <TableRow android:background="@drawable/toptab"
            android:gravity="center">

            <ImageView android:layout_width="wrap_content"
                android:layout_height="wrap_content" android:background="@drawable/logobottom" />
        </TableRow>

    </TableLayout>



</RelativeLayout>

Its running fine only problem I am facing is that list is not displaying and when I debug it I found that getView method of adapter is never called.

  • 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-11T16:47:31+00:00Added an answer on June 11, 2026 at 4:47 pm

    Your getCount method should return the number of rows that you have, based on the data you provide to the adapter. Something like this:

    @Override
    public int getCount() {
        return DATA.length;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

List<int> megalist; int boxId; boxId = ListofUniqueIDSpecificToDate.IndexOf(lstbox.SelectedIndex);<< this is wrong I'm trying to display
I'm trying to display all the products in an activity in a list of
I am trying to display a list of items in a datagrid from an
I'm trying to display a list of all events for a particular venue depending
I'm trying to display a list of check-ins in a venue using the following
I'm trying to display a list coming from my database using Linqtosql but I
I am just trying to display a list from an array that I have
In Rails 3.2, on a User show page I'm trying to display a list
I am trying to display a Spinner list for user to select, then take
I'm trying to display a dropdown list of users in my view. Here is

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.