Kindly log in to use this feature. We’ll take you to the login page automatically.
LoginCourse Queries Syllabus Queries 3 years ago
User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.
I recommend to you create subclass of some ListAdapter and in getView() method just use int position for getting position of each child and size of datasource for getting total count.
For example if you'll use SimpleCursorAdapter so use cursor.getCount() for count of items and int position parameter of getView() method for getting position of each child(row).
Basic example:
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (c.moveToPosition(position) {
String name = c.getString(c.getColumnIndex(Constants.COL));
String another = c.getString(c.getColumnIndex(Constants.COL_2));
String text = value + "(" + String.valueOf(position) + "/" + String.valueOf(c.getCount()) + ") " + another;
textView.setText(text);
}
}
No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
Kindly log in to use this feature. We’ll take you to the login page automatically.
LoginReady to take your education and career to the next level? Register today and join our growing community of learners and professionals.
Your experience on this site will be improved by allowing cookies. Read Cookie Policy
Your experience on this site will be improved by allowing cookies. Read Cookie Policy
manpreet
Best Answer
3 years ago
I got stuck in Counting
ListViewitems and show Counters on Particular ListView Items . Pleas see below for actually what I want to do:Here's a sample of ListView Items:
Syllabus (List Items Counting) < My Heading >
Ex.
I am getting these list view items from My Local Database, Please suggest me any ideas