Questions tagged [custom-adapter]

A custom-adapter is an interface which provides the ability to define non-standard iterators for specific data representations.

A custom-adapter is often used to integrate custom data structures with a view in an MVC framework.

References

990 questions
7
votes
4 answers

Android infinite Scroll List view

I want to implement OnScrollListener to load more data, when scrolled to bottom, dynamically. Following code is giving me NullPointerException, but when I declare BusinessListDataAdapter adapter = new BusinessListDataAdapter(this, …
7
votes
1 answer

Implement Expandable ListView using Custom Adapter

I want to implement a custom adapter for Expandable ListView which consist of an ImageView, and 2 TextViews. I have successfully implemented the Simple Expandable ListView with Array Adapter. What changes must be done in the following two classes…
divyang7
  • 309
  • 3
  • 10
  • 22
7
votes
3 answers

TextView in listview rows showing repeated values on scroll in Android?

I am working with custom Adapter of a ListView in which I have a TextView and a Spinner. After selecting the values from a Spinner, the value after copied to the TextView of the respective same Row of list. Problem is, As I have more than 40…
Sam-In-TechValens
  • 2,501
  • 4
  • 34
  • 67
6
votes
2 answers

Android: cannot refresh Listview using CustomAdapter

I need to refresh the list view with new data. This code below is used to obtain data in OnCreateView that is in FragmentActivity at the first time. override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, …
6
votes
4 answers

Custom Adapter not showing any data on ListView

I need a custom adapter for my listView. It needs to be passed to a ASyncTask which will get some data from a RSS feed and then hopefully set that data (at the moment Title and Date, both strings) to the row. The code I came up with is as follow…
Flatlyn
  • 2,040
  • 6
  • 40
  • 69
6
votes
2 answers

How to display multiple number of TextViews inside each row in ListView?

I am creating a Help page in which I have a set of questions and answers. These questions and answers have different styles. Here is the xml file, which describes the layout of a question & answer set:
Anshul
  • 9,312
  • 11
  • 57
  • 74
6
votes
3 answers

Removing an item from ListView inside a custom adapter

I have a custom listview item that includes a 'remove' button. I created a custom adapter called LazyListAdapter that extends BaseAdapter. Inside the getView method that I override I set this button's onclick method as follows: @Override public View…
ecem
  • 3,574
  • 3
  • 27
  • 40
6
votes
4 answers

Can't access R.layout.mylayoutname in my custom ArrayAdapter

I'm trying to create a custom adapter for my Categories list. For some reason I can't access my category_item layout when I'm trying to inflate it. Here's my code: public class CategoryAdapter extends ArrayAdapter { LayoutInflater…
6
votes
3 answers

Selection of multiple images from gallery view

I want to create a gallery view, in which I want to select multiple images using an orange rectangular box. It should look something like the following: screen look like https://i.stack.imgur.com/FsNAa.jpg
Ashish Dwivedi
  • 8,048
  • 5
  • 58
  • 78
5
votes
1 answer

how to scroll to next item by clicking on a checkbox in each item (recyclerview)

Forgive me for my English. My list contains 100 items. Each item consists of two checkboxes and I want to scroll to the next item each time a checkbox is clicked. please give me the best answer link If this question has already been answered this is…
5
votes
3 answers

how to sort the data in RecyclerView

I might seems a repetition but i am really unable to find a better way to sort the data in recycler view containing cardview. Below is the snippet of recyclerview in my mainactivity mRecyclerView = (RecyclerView) findViewById(R.id.recyclerview); …
Devs
  • 286
  • 2
  • 5
  • 16
5
votes
2 answers

notifyItemInserted() in RecyclerView and animation

When I'm adding a new item, I'm calling method public void addItem(ArrayList> arrayList, int position){ this.arrayList=arrayList; notifyItemInserted(position); } and expect to see added item animated, but only previous…
Rinat Sakaev
  • 125
  • 1
  • 2
  • 10
5
votes
4 answers

Android customAdapter (BasesAdapter) getView is always returning 0

I have made a customadapter for a listview, but for some reason the getView method's parameter "position" is always 0, which makes the method pretty useless. Here is the code of my customAdapter, extending BaseAdapter: public class…
Langkiller
  • 3,377
  • 13
  • 43
  • 72
5
votes
1 answer

Listview in SwipeRefreshLayout - does not show anything when custom adapter have only one row to show

In my app I have a listview. all things work perfectly when i have more than one item to show, but when I have one item to show in my listview, it show me a rare behave. First: if that single item height be greater than window height...it act like…
MAY3AM
  • 1,182
  • 3
  • 17
  • 42
5
votes
2 answers

Out Of Memory Exception with custom GridView

I have this code of a custom grid view and each time I try to run it, it crashes caused by an OutOfMemoryException. I guess the solution is to resize the images in the array ... main activity code : public class AndroidGridLayoutActivity extends…
Sereen Shalby
  • 225
  • 1
  • 5
  • 15
1
2
3
65 66