Questions tagged [android-arrayadapter]

1

votes
2

answer
68

Views

How to populate second spinner from a selected value of first spinner from firebase [duplicate]

This question already has an answer here: What is a NullPointerException, and how do I fix it? 12 answers The java.lang.NullPointerException occurs to many other problems too. Mine was different, because the 2nd Spinner is not getting the value from the 1st spinner. The question What is a NullPoint...
Cybertronian
1

votes
0

answer
18

Views

How do I access a View within a GridView?

I have a GridView which shows a number of colours. I want some of them to be selected, but I can't figure out how to access the individual colours in order to do that. Here's what I have so far: The GridView is drawn in a DialogFragment called DialogFragmentSelectColour. This takes an ArrayList of...
Sharon
1

votes
2

answer
195

Views

Restoring State of Spinners and Their Adapters

I am having issues trying to restore state of Android Spinners in my application. Currently there are multiple Spinners in my Activity's ListView header that depend on one another, as the selection of one Spinner loads data for the subsequent Spinner. The problem I am experiencing is, restoring stat...
JPM
1

votes
0

answer
26

Views

I am Using ListView with Spinner, Whenever I scroll the values are all deleted(Selected Values in Spinner)

Whenever I add a value to my spinner in List View, Its value is deleted while Scrolling.I have used ViewHolder also.But It shows NullPointerException while using ViewHolder. So help me by seeing the code Below. Logcat **FATAL EXCEPTION: main Process: com.example.dellt.quickbill, PID: 19323 java.lang...
Siva Kumaran
1

votes
0

answer
47

Views

How to select all files inside a folder on Toolbar item click

I have a toolbar with an option of Select All. I am trying to select all files inside a folder on clicking Select All and change background color of gridview items being displayed on screen. But I don't know how to achieve this. Some answers on this site suggested to use getview() inside adapter . B...
Cersie
1

votes
1

answer
161

Views

ArrayAdapter getFilter() with RxJava

I have a SearchView in my activity and have added onQueryTextChange listener. I have also added custom class which extends Filter class. There I have added RxJava observer as you can see on the below code. But the problem it I have to return FilteretedResults from the class but RxJava's observer's o...
Anuran Barman
1

votes
1

answer
45

Views

Screen is not showing me the list View but datasnapshot from firebase is not empty

i am not getting my list view on the screen. following code is used for application.when i tried Log.v('abcd',dataSnapshot.toString()); replies me the object as string in logcat. i dont understand in which part i have problem. logcat is not showing any errors. but my screen remains blank. FragmentL...
Shiva.AK
1

votes
0

answer
26

Views

app get turn off when i fetch data in arrayadapter through connection

when i click on the this category fragment button in drawer when internet is available the app get close, and if internet connection is not available the it does not stop and shows no data available public class CategoryFragment extends Fragment implements OkHttpInterface { ListView listcategory;...
Soaham saraswat
1

votes
1

answer
76

Views

How to Retrieve Multiple data when clicked on listview?

I want all edit text content that I have saved in SQL to be displayed on the edit bills activity when I click on the list item, but I am only able to retrieve the name and display it again in the intent. Rather than saving another data it should update the record with the new data if I save the exis...
dhruv sachdeva
1

votes
2

answer
81

Views

Does the ArrayAdapter have a method that returns the whole List that was passed to it in the constructor?

I learned that you should not save the List or the Context in a custom ArrayAdapter field, because after passing them to the super method like this: public CountryAdapter(Context context, ArrayList countryList) { super(context, 0, countryList); } we can access these values with getContext and getIte...
Florian Walther
1

votes
1

answer
37

Views

highlight single item listview

I am facing some problem using a listview to highlight a single item. I've created an anonymous adapter as in the code below but when the list is displayed several items have the highlight/bold. The log trace shows the bold/background only being called once and yet several items have the bold but on...
Joseph Rand
1

votes
1

answer
66

Views

How to get the object of selected checkbox?

I'm making a shopping list App in android with firebase, I obtain the list of items , and show in array adapter well.When I need to check an item and change it in Firebase . I don't know if I have to do that in the array adapter or in my fragment. My class is itemCart and extends from another Food t...
Kargol
1

votes
1

answer
52

Views

ListView showing less items after updating adapter - android

I am pulling some data from JSON to my ListView using my custom adapter: adapter = new ActorAdapter(this, R.layout.data_item, actorsList); The JSON contains 5 items. Everything is fine, all items are showing, but... as I am using also Location services, I need to update the ListView (distance etc.)....
wotan
1

votes
2

answer
44

Views

fetching data from two string array to two different layouts into a single listview

i have seen many answers and i changed my code accordingly. now i am stuck with my own problem.after running this adapter , i am getting one value from list1 and only two values from list2 where both have three values.the layouts are coming fine.i don't know what is causing it and i am also not that...
1

votes
1

answer
139

Views

how do you make arraylist from firebase database to populate in ArrayAdapter?

personTypes from database: { key = personTypes, value = {RESIDENT_HOMEOWNER=Resident Homeowner, RESIDENT_VISITOR=Resident Visitor, RESIDENT_RELATIVE=Resident Relative, RESIDENT_TENANT=Resident Tenant, HELPER_OUT=Helper Stay-out, PERSONNEL_1=Personnel 1, MAINTENANCE=Maintenance, PERSONNEL_2=Personnel...
Ina Yano
1

votes
1

answer
252

Views

error: no suitable constructor found for ArrayAdapter(Tab1Fragment,int,ArrayList<String>)

im new to programming and been trying add a list view + arrayadapter to a Fragment for a school project. Have referred to this question but to avail. https://stackoverflow.com/questions/32350275/no-suitable-constructor-found-for-arrayadaptermainlistactivity-getblogpoststask#= package com.tabian.tabf...
Jay
1

votes
0

answer
10

Views

Android Listview not displaying added items

I had a listview that was working fine and displaying Items which we're being created after taking a photo and then added. Now, for some reason, it doesn't. What's particulary strange is that if I add the items in the same place where I initially create and set the adapter, the phone DOES show them....
felisimo
1

votes
1

answer
35

Views

OnClick Return wrong position and data to filtered text on listvew

Respectable Gurus Bellow code return wrong position and data by clicking on listview filtered Item of ArrayAdapter, Any Suggestion will by highly appreciated. Listview can be easily and perfectly filtered by bellow code by on setOnItemClickListener` it returns Wrong position. Any Suggestion will by...
Ambreen Khan
1

votes
1

answer
43

Views

ArrayAdapter in an onClickListner is not working

What I am trying to do here is to display a list of strings using ArrayList and ArrayAdapter when a user clicks a button. I want to declare all the members i.e. adapter, ArrayList and the list layout as global because I want to add more buttons later with the same feature of displaying a list of str...
Bbake Waikhom
1

votes
0

answer
37

Views

How to populate an ArrayAdapter with a List of objects from a Firebase Database?

I'm trying to populate my ListView with User objects from Firebase Database. I've seen some people use RecyclerView but I cannot get RecyclerView to work on my Android Studio (maybe i'm using incompatible dependencies). Anyway here is my code: // necessary imports public class List extends AppCompat...
ciem93
1

votes
1

answer
61

Views

Android custom ArrayAdapter rendering Objects in list, not values

I'm trying to bind a custom layout (a LinearLayout containing two TextViews) to a Spinner. I subclassed ArrayAdapter (mostly) correctly. Selecting an item in the Spinner calls getView() correctly, setting the LinearLayout's TextViews' values correctly. The problem is the initial display of the items...
TheDudeDude
1

votes
1

answer
33

Views

Android: Fast scrolling ListView weird behaviour of getPositionForSection

I'm trying to implement a listview that has fast scrolling with header previews. It looks like it's almost working correct, but I'm encountering some weird, bug-like behaviour. When I scroll down without using the fast scroll bar, the fast scroll bar disappears, and reappears only almost at the end....
Simon
1

votes
0

answer
32

Views

Listview not updating but in logs adapter is changing data

I have created a generic ArrayList and generic array adapter for the custom view that contains a search view and listview. for this listview, I have created generic ArrayList and generic arrayadapter that I will be using just for updating the data and setting it up on listview.i am dynamically updat...
Avi Patel
1

votes
0

answer
134

Views

Load Database values in RecyclerView using ArrayList and adapter

I have an Android Notes add, delete, update application. In my main activity, I have a Recycler view which is retrieving data from the database class using an arraylist. Below given is the DatabaseValues class: DatabaseValues.java .... initial code .... public List getAllNotes() { List notesList =...
kirti
1

votes
1

answer
36

Views

Checking which ArrayAdapter Spinner currently uses

I have four ArrayAdapters that uses 4 different arrays adapter1 = new ArrayAdapter(getApplicationContext(), android.R.layout.simple_spinner_item,getResources().getStringArray( R.array.array1) ); adapter2 = new ArrayAdapter(getApplicationContext(), android.R.layout.simple_spinner_item,getResources()....
GremlinShX
1

votes
0

answer
21

Views

Unable to use Animator from different Class on Custom AdapterView<ArrayAdapter>

Please help on this issue. I have a custom Class CardList public class CardList extends AdapterView There is a Player class which uses this custom view. CardList have Touch,Drag event listener. TouchListner determines the View Click as well. When View is clicked, a callback it made to listener funct...
i_quit
1

votes
1

answer
28

Views

Can't retrieve the data from Adapter class

My intention is to notify the user via eMail. Though my intent is working fine on retrieving the data, it says me null in mail to the sender Fetching the data always returns me null. Please help me to retrieve the data. Here is my adapter class: public class adminDetailsAdapter extends RecyclerView....
Thiyagu
1

votes
1

answer
28

Views

My searchview/filter does nothing when typing inside

I have written code for an app that is designed to read XML and populate a listview with the data read. The data is stored in a containing class. I've created an adapter class as well as a custom filter. For some reason, when I type inside my searchView, nothing comes up! I've looked all over youtu...
Chris Cherryholme
1

votes
0

answer
35

Views

Item on cart of recylerview can be inputed all to database

Hi i got some problem to insert my data through database, which i just send it only one item on recylerview here is my code of cart and php that i was using it off komen.php
Floren
1

votes
0

answer
42

Views

Create new TextViews inside custom array adapter

I am trying to create Dynamic Text Views extracted from an array list inside a custom array Adapter. The array list data is returned from from JSON response. Since I don't know in advance how many items my array will contain, I can't create Text Views in XML, so they need to be created programatical...
M. Elauzei
1

votes
0

answer
39

Views

Android ListView with ArrayAdapter replacing list item components

Please check the last update down below as I found the issue but don't know how to fix it [Update: project download link] which is very tiny it's just a sample and added Questions class I'm creating a ListView with ArrayAdapter for a quiz. every question has 3 answers as radio buttons. The problem i...
PHP User
1

votes
1

answer
3.6k

Views

Android Update a Progress Bar which is set inside custom ArrayAdapter

Hi i have a problem updating a progress bar. First i have a custom adapter in which i create a row for each item with a textview and a progress bar. (i have a item_row.xml in where i define the layout for each row) public View getView(int position, View convertView, ViewGroup parent) { ..... Progr...
xger86x
1

votes
1

answer
3.4k

Views

Styling added rows to ArrayAdapter ListView Android

I have a ListView that I want to use with an ArrayAdapter to add different styled rows. The rows are created on different states in my application, and depending on the different states the rows should be styled(like colors and stuff). Here is some pseudo-code: on creation: mArrayAdapter = new Array...
James Ford
1

votes
2

answer
3.2k

Views

getView() for ArrayAdapter is slow

When a user selects a ListViewItem, I am changing that row's background image. This seems to happen very slowly. I'm not sure why? OnItemClickListener listView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView a, View v, int position, long id) { //quote...
Sheehan Alam
1

votes
1

answer
1.2k

Views

ListActivity/ListView content is “disappearing”

I'm having a problem with my ListView in a ListActivity with a Custom ArrayAdapter. When the ListActivity becomes hidden (paused, whatever), the data that was present in the ArrayAdpater seems to go away. Rotation works fine, but I am only assigning the array in the ArrayAdapter in the onCreate(),...
Kenny
1

votes
1

answer
2.4k

Views

Android: onItemClick only returns first selected Item

I'm using and ArrayAdapter to populate a ListView. After selecting and item, it displays a confirmation Y/N dialog. If the user's choice is negative, then he should be able to select another item showing the same dialog. And so on. Here's my code: lView.setOnItemClickListener(new OnItemClickListener...
Marco Sousa
1

votes
1

answer
1.7k

Views

Android External vs Internal Database Confusion

I am working on my first Android Application and I am trying to implement a database with a bunch of food types (strings) such as 'Beef, Pork, Chicken' and have cook time values (int) for them such as 10000,50000,30000 etc. My question is what is the best way to implement this. I feel like the best...
SickNick
1

votes
2

answer
2.9k

Views

notifyDataSetChange() not updating DataGrid() via ArrayAdapter()

In the code below have a variable of type List '' named 'stringList' which is bound to a GridView view via and ArrayAdapter. The code below runs a for loop which creates a string and adds it to 'stringList'. As can be seen in the LogCat output the ArrayAdapter's getView() function is triggered when...
Ben
1

votes
1

answer
8k

Views

Android spinner prompt not working [duplicate]

This question already has an answer here: How to make an Android Spinner with initial text “Select One” 36 answers I have Spinners that I am using in my application. They are working fine with one exception. I have set prompts for each one, but they are not showing. I am setting ArrayAdapters t...
srowley
1

votes
1

answer
3.8k

Views

two textviews in listview with arrayadapter and arraylist

i m displaying a listview with two textviews .the first textview is used for displaying the name of the location and the second one is for displaying address. i anm retrieving values from database and adding those values in an arraylist. i used a custom arrayadapter class named myadapter inflated th...
hussain

View additional questions