Most voted "android-adapter" questions
Adapter on Android is an object that bridges the gap between an Adapterview(e.g., Listview) and the data set it shows. Provides access to items and is responsible for creating a View for each of them.
Learn more…122 questions
Sort by count of
-
12
votes2
answers235
viewsHow to avoid an Illegalstateexception: The content of the Adapter has changed but Listview Did not receive a notification?
I have a Activity that displays a ListView, to which a Adapter "backed by" a ArrayList global. If I add an element to that ArrayList, ideal is to do it in the main thread and immediately call…
-
11
votes2
answers2958
viewsWhat are Loaders? How to implement a Loader to load from the database without content Provider and how to implement a custom Loader?
On the Internet, at least in my research, I found little material on Loader in Portuguese. That is why I record here this question, to have documented answers to the android programming community as…
-
11
votes2
answers8134
viewsWhat is the right approach to get the click/position in Recyclerview?
What is the right approach to click on Recyclerview? 1 - Inside onBindViewHolder use position, even if within setOnClickListener methods, which turns the position variable into FINAL; 2 - Inside…
-
8
votes1
answer1772
viewsWhat is Viewholder Pattern?
I’m implementing a RecyclerView on Android and I noticed that it is necessary to create a class called ViewHolder. This class seems to be a design standard called Viewholder Pattern, and my doubts…
-
8
votes1
answer374
viewsHow to assign an Activity to open by clicking on the Actionbar Tab?
Context I have an application that contains a Activity calling for MapActivity (of which is a Map activity you inherit from the Googlemaps api), and another Activity which will serve as a search…
android android-fragment actionbar android-adapterasked 9 years, 4 months ago Paulo Roberto Rosa 8,979 -
7
votes2
answers4442
viewsHow to delete a specific Listview item?
I would like to ask a question: I have one ListView, in which his Adapter is clarified in the same Activity and the content of Adapter (as strings) are in another class, in another package. How do I…
-
6
votes1
answer350
viewsCan you create an Expandablelistview with the Swipe effect?
I have a ListView which is composed of 3 ListView's chained. The first is a list of Year of release, which has a list of genres that in turn stores a list of movies. I wanted to have the option to…
-
6
votes2
answers1240
viewsWhat is the purpose of the Recyclerview.Adapter class when using Recyclerview?
To use the Recylerview Android we need to create a class CustomAdapter extending from the abstract class RecyclerView.Adapter then implement three methods that are: onCreateViewHolder…
-
4
votes1
answer271
viewsEdittext issues in a listview
I’m trying to get my listview retain the values placed on EditText, but every time I give one scroll I lose the data or it multiplies to other fields. Can anyone help? Follow below mine adapter:…
-
4
votes1
answer552
viewsHow to use a custom Adapter on android Listfragment
Hello folks I’m having problems with using a Adapter customized and display this Adapter in a Listfragment. My Custom Adapter public class UsuariosAdapter extends BaseAdapter { Context ctx; List…
java android listview android-fragment android-adapterasked 9 years, 3 months ago ThiagoDeveloper 55 -
4
votes3
answers1444
viewsList of questions, each question with a list of answers
I’m implementing a question and answer app. For my listing I am using a Recyclerview in which I load several Cardviews (coming from loading a list). Each Cardview shows a question. Below the text of…
android android-layout android-adapter android-recyclerviewasked 8 years, 12 months ago SpammingOff 387 -
3
votes2
answers120
viewsCreate a Generic Adapter
Good evening! Dear friends, I have a question , has anyone ever come across the situation of having several lists but with similar information? a simple listing of information coming from the…
-
3
votes1
answer250
viewsFirst element in listview does not appear
I have a listview that lists through an Adapter. The list is updated after a Sqlite search. The problem is that it only appears from the second element of my table.... someone could help me?…
-
3
votes0
answers71
viewsEvent triggering multiple times when using Recyclerview
I’m having a problem working with RecyclerView. Man Adapter has the following code: public class CustomAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { private…
-
3
votes1
answer659
viewsSave status of a Checkbox
I need to save the status of my Checkbox, they’re inside a Spinner, and every time I open Spinner he cleans the Checkbox. Admlistagem.java final String[] select_qualification = { "Todos", "1", "2",…
-
2
votes1
answer1074
viewsBackground Color of Listview in zebra
I have a layout with two Edittext and an Imageview that will be added to Listview via Basedapter. I wanted to change the background color of Listview in zebra. The problem is that if Listview has…
-
2
votes1
answer853
viewsPopular a Listview with Arrayadapter
I need a popular ListView. I have a class that represents the Entity Cliete, a class that is responsible for the database database and finally a class ClienteDAO, that the data of the entity remains…
-
2
votes1
answer890
viewsChange the Listview Background color when the key value is found
In my app I have a ListView which is provided through BaseAdapter. Then in the BaseAdapter i have an IF statement to change the list background when the value of a variable was equal to the value of…
-
2
votes1
answer335
viewsDoubt about the operation of Basedapter and Listview
My code is as follows: in the method getView of my BaseAdapter, i add all created views to a list (I need this to do a certain thing). In that same Basedapter, I have a method getQuantViews that…
-
2
votes1
answer54
viewsRemove child from an Expandedlistview
Hello, I would like to know how to remove a subitem from an Expandedlistview, in other words remove the Adapter item, where the Adapter receives a Map<Categoria, List<SubCategoria>> and…
-
2
votes1
answer341
viewsCustom Spinner showing Resource and non-text
I’m having trouble setting up a custom spinner in my application. Follow below picture of how it appears: Follows my code: Java adapter. public class ProfissionalCategoriaAdapter extends…
-
2
votes1
answer365
viewslistview with text image and subtitle
I’m building a sales app where a user will publish their product with: image, price, description and value. I can list the photo all right but I can’t put a title and the other descriptions Here’s…
java android listview android-fragment android-adapterasked 7 years, 10 months ago Felipe Moreira 25 -
2
votes2
answers611
viewsHow to delete a particular data from a listview?
The app has two Uttons that when clicked add an item to a listview (bow and sword), but I would like if the item of each button was already present in the listview, the same would be deleted.…
-
2
votes1
answer94
viewsHow to get the Listview reference of a Listfragment?
I’m with a ListFragment trying to access the ListView in which the Adapter inserted the objects, but the findViewById is returning null, anyone has any idea? The XML Fragment code: <?xml…
java android listview android-fragment android-adapterasked 7 years, 6 months ago Danilo Nadolny Vizentainer 23 -
2
votes2
answers53
viewsDoubt Listview
I have the following code below where I am with doubt as I do to display the list on the screen, I have tried several ways and I have done several examples of the internet I could not get a correct…
-
2
votes1
answer112
viewsUpdate fragment with Listview
I intend to "refresh" a fragment (fragment30.java) that displays the records of an Sqlite table after the deletion of one of these records . The records shall be submitted using a Listview…
-
2
votes1
answer102
viewsMessage from "Empty Child" on an Expandable Listview on Android
I want to create a statement to the user stating that a Group of an Expansible Listview does not contain any Child (That the group is empty) as in the image below. Searching the net, I noticed some…
-
1
votes1
answer4475
viewsEdit item within Listview
Hello. I am working on a code that loads items inside the Listview through a Adapter. Within each item (item_list.xml), I inserted two buttons being one to delete the item and another to edit. The…
-
1
votes1
answer140
viewsHow to use an array within getView on an Adapter?
Here’s my problem, I’m passing a sequence of arrays to an Adapter that should be placed inside a listview, among these I have a two-dimensional array called materials : public View…
-
1
votes0
answers213
viewsGroup recyclerview items by the.time item similar to facebook messenger
I’m trying to create behavior similar to what happens in Facebook Messenger, when sending several consecutive messages, for this I created several background drawables with border radius to be…
-
1
votes3
answers303
viewsWhen I roll my listview I miss checkboxes marked
This is a code from my Adapter, in it I have a textview and 4 chekboxes. The problem is that I believe I have to save the status of my checkboxes, not to lose the data from it, because when I roll…
-
1
votes1
answer63
viewsHow to return the focus on an Edittext after a notifyDataSetChanged() in recyclerview?
The problem is with notifyDataSetChanged() when I update recyclerview Edittext loses focus wanted it not to lose focus, already tried with requestfocos does not give.
-
1
votes1
answer74
viewsRecover the amount of children who have a knot
How do I recover the amount of children you have in a knot? I already have the right path, I just need to know how to count the children of this knot. private DatabaseReference qtdeFilRef;…
-
1
votes2
answers187
viewsAndroid - How to create a comparison so that items from LISTVIEW are displayed or not according to the date?
I’m creating an app that will show open pharmacies on a certain date: I created a listview with 10 lines (pharmacies)... And according to the day of the month certain units will be displayed... or…
-
1
votes1
answer808
viewsMark/Deselect Radiobutton Component in Expandedlistview
In a question I asked here at Stackoverflow a few days ago I was instructed to use the Expendedlistview component to represent a dynamic list of items. After the implementation I saw that the list…
-
1
votes1
answer287
viewsHow to give a list of images the behavior of a Radiogroup?
I have 2 image vectors, one for the normal image and another for when it is selected. When selecting an image on ListView I need the others not to be selected. I’ve tried many ways and this was my…
-
1
votes0
answers721
viewsHow to add the values of an Edittext that is on a list via an Adapter?
I have an application with a dynamic size list, which works together with an Adapter that contains 3 Edittexts, in which I name valor1, value2 and ream respectively. The functionality is very simple…
-
1
votes1
answer213
viewsMy app that has Listview with Arrayadapter is closing when creating the list
I’m looking to make a product listing, where each line contains more than one information per line. The problem is that the app throws exception (I believe) and closes when I click the button that…
-
1
votes1
answer53
viewsError trying to fetch Sqlite ID via Spinner
Object Book public class Livros { private int id; private String nome; public Livros() {} public Livros (int id, String nome) { this.id = id; this.nome = nome; } public int getId () { return id; }…
-
1
votes1
answer209
viewsHow to create a custom filter in the android lestview that searches for words after the space character
In this code the filter is working until the first word. From the moment I enter the space character the filter stops working. Example: Search "Steve Jobs", the system gets lost. Now if you search…
-
1
votes1
answer328
viewsUpdate data in Listview with Arrayadapter
I have a Listview that will be filled with some different data, which may or may not be called (simultaneously or not). Example: The user can add and remove ingredients from a product. However, he…
-
1
votes2
answers604
viewsRecyclerview, problem inserting an item
Talk guys, I’m new on android, I have a problem here, I’m trying to insert items in a Recyclerview, when I use the direct method on the button it is inserting statically good: public void…
-
1
votes1
answer75
viewsGridview - Items repeating randomly
I’m having a problem in grid view. This grid contains n products that are displayed on the screen, thus the grid of some users have scroll. When there is no scroll the products are normally…
-
1
votes1
answer406
viewsjava.lang.Indexoutofboundsexception: Invalid index 4, size is 4
I’m not sure what’s going on, when I long click on a list item, it sometimes works normally (open a screen where it shows the user the registered information, allowing them to change it), sometimes…
-
1
votes1
answer453
viewsHow to call a method in Fragment via listview Adapter
I have a fragment that has a listview inside it and inside lisview has a button. The button has to delete the listview item I have already made a method within onactivitycreated, but gives error…
-
1
votes1
answer126
viewsNullpointerexception when running Listview.setAdapter (Android)
i am implementing an application where I need to display a list of Dogs (already registered in BD) and allow clicking on an item in the list to display a new activy to edit the data. The problem is…
-
1
votes1
answer128
viewsMy BD search placed in a listview (Arrayadapter) returns the object address and not the content
I made an APP that saves the date and a series of numbers (8 numbers) in the Android database. I created an object ( with date and numbers), but when I search all objects inside the database and put…
-
1
votes1
answer82
viewsHow to call an Interstitial by clicking on a list item that passes through an Adapter?
I need to call a Interstitial in this Activity by clicking on a list item that comes from my Adapter: public class ListOfTemplates extends AppCompatActivity { private Template template; private…
-
1
votes2
answers385
viewsChange background image of a Recycler View Adapter after click
The thing is, I created a Adapter amending a RecyclerView in an Activity I call through this function (within Activity): private void gerarDatasView(CalendarJur calendario){ LinearLayoutManager…
-
1
votes0
answers27
viewsHow to display an Imageview only while the user is "holding" the screen?
I’m making an application and in one of the fragments I have a Recyclerview being used to list some view holders with some textviews and an image view. I implemented a simple Adapter to display a…