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
3
votes
3 answers

If I click the button in listview which is inside getview I want my two views to set visible

Inside getView here addprod.setOnClickListener I am making two views visible as you see 0 and minus button in the image if I initialize final Button decprod=(Button)convertView.findViewById(R.id.decprod); final TextView…
Ruban
  • 1,514
  • 2
  • 14
  • 21
3
votes
1 answer

HorizontalScrollView custom adapter?

I'm trying to make a Gallery widget using HorizontalScrollView, So inside the HorizontalScrollView I add ImageViews, and the problem is that I'm going to add 600+ images! Can I make some kind of a custom adapter in order to override the GetView…
Omar
  • 7,835
  • 14
  • 62
  • 108
2
votes
1 answer

Android - custom adapter for multiple choice listview

i need to read the contact list in my android app and show it to the user with a multiple choice option. I've just seen the android example with the ListView.CHOICE_MODE_MULTIPLE but i need something different, i want a custm layout. I need to show…
Christian Giupponi
  • 7,408
  • 11
  • 68
  • 113
2
votes
0 answers

Numeric softkeypad appears and instantly changes to normal keypad

HI all I was looking for a little help with my numeric softkeypad and an EditText. I have an activity with basically a 2 column table which has 1 column editable via EditText. I want the numeric phone keypad to appear when an EditText is clicked.…
2
votes
1 answer

Loading Image using AsyncTask

I am trying to create a custom List Adapter which has an Image for every item it needs to download from the internet. When I first enter the Activity - the app freezes for a while till the images are downloaded and then the Activity List is loaded.…
Harsha M V
  • 54,075
  • 125
  • 354
  • 529
2
votes
1 answer

Image in List View Adaptor

I am trying to create a Custom List View Adapter by extending the ArrayList When i do the following i am not able to get the Image from the URL and display it in the List View but it displays the default Image from the XML Item.java public class…
Harsha M V
  • 54,075
  • 125
  • 354
  • 529
2
votes
1 answer

Storing the state of checkbox in listview while using custom BaseAdapter in android?

i have a listview which is having image, text and checkbox i have inflated this using BaseAdapter. i want to send only those images which are selected but how to store the state of checkbox ? may be i am wrong as i am using baseadapter. you can…
School Boy
  • 1,207
  • 2
  • 19
  • 33
2
votes
2 answers

Hide and show multiple view holder from RecyclerView Adapter Android

I have two view holders in my custom adapter say ViewHolder1 at position 0 ViewHolder2 at position 1 Currently with view is perfectly fine. Now i have button in MainActivity. I want to do something like this in layman's term On 1st click, it should…
2
votes
0 answers

How to filter a ListView with custom adapter including two TextViews in Java

I had a huge problem designing a custom arrayadapter, that can be filtered by writing text into an EditText. The regular way is to override the existing getFilter() with your custom getFilter() function. I thought, I should share my solution to all…
DarkCat
  • 21
  • 1
2
votes
2 answers

SwipeCards not showing using custom adapter

I'm developing an app like tinder using this swipe card https://github.com/Diolor/Swipecards . I made a custom adapter which set data to swipecard. everything is fine i checked logcat where data printing. i checked logcat of getItemCount(). it…
2
votes
1 answer

ViewHolder cannot be cast to OtherViewHolder

I have a problem with my Recyclerview's custom adapter. I'm trying to display two different views with different data source in one recycler view. It was working great before I make some changes and now it gets an exception. It's working fine until…
Hossein Yousefpour
  • 3,827
  • 3
  • 23
  • 35
2
votes
2 answers

getFilter() on a custom ArrayAdapter not working

I am using a Custom ArrayAdapter to store User information for example sammy, robert, lizie are each one User objects and i am using a User type ArrayList to store all the User objects to ArrayList. And because it is not a string or int (The…
2
votes
0 answers

In nested Fragment,when TabLayout changes new instance of fragment added but RecyclerView not updating

I have a Fragment named HomeFragment, consisting of a TabLayout and ViewPager in it. TabLayout is populated with data from backend. So each tab item has a name and on changing the tab position, I fetch data from backend and add another fragment,…
2
votes
1 answer

What is a convert view in adapter? And how it's works?

I can't understand what is a convert view.. Specifically, when does the program enter if condition and when else condition? public View getView(final int position, View convertView, ViewGroup parent) { final ViewHolder holder; …
2
votes
2 answers

Why can't I use the var mSelectedItem in inner class ViewHolder?

I define mSelectedItem as a public var in the class CustomAdapter, I think mSelectedItem=getAdapterPosition() will be Ok when I use mSelectedItem in inner class ViewHolder. But it failed, and display "Unresolved reference: mSelectedItem" error,…
HelloCW
  • 843
  • 22
  • 125
  • 310