4,366 questions
-1
votes
1
answer
44
views
Why does the custom ArrayAdapter constructor in this example not match the superclass constructor exactly?
I was following a tutorial on creating a custom ArrayAdapter for a ListView in Android. Here is the custom adapter class from the tutorial:
public class NumbersViewAdapter extends ArrayAdapter<...
0
votes
1
answer
277
views
Android Talkback changing contentDescription and action for dropdown view element?
I have a dropdown represented by an ExposedDropdownMenu style on a TextInputLayout view element.
<TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox....
0
votes
2
answers
79
views
updating listview when data is removed from the arrayadapter
Im creating a listView and setting a custom arrayAdapter to it in my main activity. Using an onClickListener within the getView method of the adapter to try and remove the item clicked. Its being ...
1
vote
0
answers
44
views
How to do Song Track list with fragment in Android Studio?
I'm new in android studio, just learned about a week. Before this project , I made a simple SongTrackList using main activity with no fragment, it can run smooth (click ImageButton , audio works). Now ...
0
votes
1
answer
36
views
Resource Type issue in arrayAdapter
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(MainActivity.this, android.R.layout.simple_list_item_1, R.array.lsViewArray );
lsViewArray.XML:
<resources>
<string-array ...
2
votes
1
answer
37
views
Recycler View is Not Showing Even After Adding Data in Array List & adapter.notifyDataSetChanged()
There is a RecyclerView suggestList and on clicking any itemView of it, we get adapterposition() which has passed through a function to get values from ArrayList used for suggestList adapter. Now, I ...
0
votes
1
answer
310
views
Setting AppCompatAutoCompleteTextView dropdown width with margins
I have the following AppCompatAutoCompleteTextView -
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
android:id="@+id/phoneNumberPrefixTextView"
style=&...
0
votes
1
answer
43
views
Can I use adapters without having ListViews?
I receive lots of data from the backend that I need to display in 2 sections of my app in different ways, such as drawing real time graphs. 1 of the sections in question is a rectangle, that is just ...
0
votes
2
answers
49
views
When are constructors one and two used in the ArrayAdapter?
ArrayAapter Class have some constructors:
When are constructors one and two used? Because we don't have data structure like input array or list at all in these constructors. If possible, explain with ...
-1
votes
1
answer
175
views
Update the cart total amount after delete item from shopping cart
This is an e-commerce app, I am facing an issue related to (adding/removing) items from the cart, The problem happened when I added two items and then if I removed one of them, The total amount is not ...
0
votes
1
answer
37
views
How I can store multiple links in RecyclerView and than use those links in Adaptor class
how i can store different urls and each url acts differently when clicked by the user
This is data model class
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import ...
0
votes
2
answers
60
views
AutoCompleteTextView & ArrayAdapter with back to Fragment
(sorry for my english)
I have fragment where I have an AutocompleteTextView and ArrayAdapter for it.
ArrayAdapter get values from resource strings.
When fragment creating first time — everything is ok,...
0
votes
1
answer
42
views
Same Instance of an arrayAdapter in Two ListView doesnot work
I have two fragments in my Activity. Both of these fragments have unique listView, these fragments have methods that get values from database, One fragment shows used data and the other shows added ...
1
vote
1
answer
921
views
How to fill a Spinner from my code in Java (Android Studio)
I'm making an example with Android Studio and I want to add items to a List that is displayed in a Spinner. Looking here, I found this answer that helped me a lot.
Basically I create an ArrayAdapter ...
1
vote
0
answers
95
views
Dropdown popup not display while search on autocompletetextview inside recyclerview in android
I have stuck with this issue more then 3 days. I have used one RecyclerView and on recyclerview's each item have on AutoCompleteTextView. When try to search on autocompletetextview drop down not ...
0
votes
1
answer
169
views
I can't reach my layout file in my adapter with R.layout.(file_name)
I am trying to add custom layout to change my selected item text in my spinner. But I couldn't reach my layout file with R.layout.my_selected_item in my array adapter. It is saying "Unresolved ...
0
votes
1
answer
61
views
Add a new item in ArrayList Adapter outside its area
So I'm having here a problem adding a new item on a ArrayAdapter-ArrayList if I call a .add outside or inside another public void. I'm using a list view that is inside xml file and replace it with ...
0
votes
0
answers
391
views
java.lang.ArrayIndexOutOfBoundsException: length=22; index=-1
i am very new to Android Studio and making app with my WordPress website and using Rest Api to fetch data from my website , all works fine and i have added sort posts menu in my app and users can sort ...
1
vote
1
answer
1k
views
Add data dynamically in recyclerview kotlin
please I'm trying to dynamically add a textitem via an EditText by clicking a button in a Recyclerview, but when I click the button to add the text in the Array related to the Adapter and I apply the ...
0
votes
1
answer
36
views
error when creating custom array adapter in kotlin
I allready created some custom array adapters and they all work. I created this one like the other ones but I keep getting this error:
"android.view.InflateException: can be used only with a ...
0
votes
1
answer
71
views
If I Add the item on the recyclerview the item add duplicate
First time, If I add the item(click the send button) on the recyclerview, it does successfully,
but
if I add the item second time, I expect see the item 1,2 but 1,2,1,2 add to the recyclerview
I'm ...
0
votes
1
answer
207
views
What means R.Layout ? R.?
i dont understand what is meant by R.layout or R.array in the following code, who describes
how to fill a spinner with drop-down menue with a array who has different countries as its elements:
adapter ...
0
votes
1
answer
278
views
Android - Material Exposed Dropdown Menu options not populating
I am trying to create a material exposed dropdown menu that is rebuilt when a fragment is revisited. On initial visit to the fragment, the menu is properly created (it helps create a timer). The ...
0
votes
1
answer
53
views
Spinner keeps last selected item
I have a spinner with an array adapter. The spinner is populated inside a fragment onCreateView().
spinner.setSelection(0)
spinner.onItemSelectedListener =
object : AdapterView.OnItemSelectedListener {...
0
votes
1
answer
350
views
How to show JSON data into RecyclerView using adapter in Kotlin?
I have succeeded pulling JSON from Reddit API but I cannot put it into my RecyclerView. I set a Log to check if my JSON is empty or null, and the Log successfully print the desired output, so that ...
0
votes
1
answer
215
views
Increment and decrement in recyclerview android
I am displaying a product in recyclerView. I have 2 buttons + to symbolise increment and - to symbolise decrement. Once the user adds product if he clicks + product quantity should increase and if - ...
0
votes
1
answer
562
views
TextInputLayout with AutoCompleteTextView using ArrayAdapter set Selected Item
I have a TextInputLayout with AutoCompleteTextView as a 'Spinner'. I populate the AutoCompleteTextView with an ArrayAdapter like this:
val adapter: ArrayAdapter<Currency> = ArrayAdapter(...
0
votes
0
answers
27
views
How to manipulate bottons of a listView
I have implemented a customAdapter and a listView, and everything works correctly, the problem now is that not as well as finding the id of each element created, I have to use methods in another ...
1
vote
1
answer
94
views
Passed data from Activity to Adapter, but when I try to use data as string, it displays as null
I have passed data from my Activity to My Adapter. When I debug, I can see the correct data has successfully passed to my adapter, but when I attempt to use it as a string ( for example, if I want to ...
0
votes
1
answer
670
views
How to deal with android Collection errors?
While developing Android, I wrote Adapter code for RecyclerView. But intermittently, the app closes abnormally. As a result of checking through Crashlytics of Firebase, the error contents were as ...
0
votes
2
answers
2k
views
Android Kotlin-simple Array Adapter with ListView
I am new to Kotlin and/or coding. The below mentioned are the code I made to populate a List View. But as I run the code, the activity_main.xml file is inflated but the text data are not attached.
...
0
votes
0
answers
69
views
Crash with recyclerView on fragment in basic activity
My project to make recycler View with dynamic list which is defined on Note type List on fragment in Basic Activity, first step for me to code the adapter, and cause am just at beginner level, I ...
0
votes
1
answer
32
views
Why code is not showing the List in the spinner that call with API?
There is an Array of String that passes from the API. What is the problem with the code?
I am trying to pass that value into a spinner
Call<List<ResponseSubject>>
subjectOption=...
0
votes
1
answer
99
views
Fit 2 textViews in an adapter , java , android
I am creating a note-taking app for myself, I created an adapter to show notes on the main screen with a title view and text view but the app crashes when I launch it
here is RecyclerViewAdapter.java.
...
1
vote
1
answer
562
views
How to pass a string-array from the function to the activity in android kotlin?
I am trying to pass a string-array from function to activity. I want to use that array into the spinner. But when I am trying to do this, I am passing an array but the function wants to pass a array ...
0
votes
1
answer
82
views
How can i set the layout_height from ListViews in conditon of the number of items in a string-array
Good evening,
I have an Android app with two ListView elements on a layout. between them is a TextView element. The whole is framed by a LinearLayout and a ScrollView and a ConstraintLayout.
...
1
vote
2
answers
1k
views
get arrayList value into ArrayAdapter for a listView in android studio
I am trying to put one piece of value in an ArrayList to my listView, below are the details.
Here is the sample of the ArrayList info:
private static final ArrayList<User> users = new ArrayList&...
0
votes
0
answers
93
views
ListView in Fragment not showing any Items ANDROID
I'm trying to use a ListView in my Fragment which is displayed by a TabViewer2. The listadapter I used is the ArrayAdapter<String>. Unfourtunately the ListVIew does not show any Items. However ...
0
votes
1
answer
51
views
I cant refrence the adapter
I have an adaptor that I initiate in onCreate and a listview that I initiate in onViewCreated
I'm trying to setAdapter but I can't pass the adapter in onViewCreated.
Ive tried multiple things like ...
-1
votes
1
answer
497
views
ListView Array Adapter error"None of the following functions can be called with the arguments supplied."
I'm trying to create a fragment with a ListView with the id=lv and the ArrayAdapter doesn't seem to work
this is the fragment code
class Istoric : Fragment() {
var array = arrayOf("item1"...
1
vote
1
answer
47
views
Recyclerview in android scroll moving on its own
I have recyclerview contains many problem videos i have namely: when I click on any video move the list on its own down the list
recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
...
1
vote
1
answer
67
views
How to declare two types of layout access one method first one (Post) next( Ads) using one method in adapter class
Is there possibility to have post and ads methods in two class based view?
I tried to do something like this but of course it doesn't work and error it not working (layout ads) Id
enter image ...
0
votes
0
answers
11
views
Adapter not displaying document fields on cardview but able to read the number of documents in a firestore collection [duplicate]
I have an adapter that's supposed to populate my recycler view. The adapter seems to be working because it is able to read the exact number of documents in the firestore collection. However, I need it ...
-3
votes
1
answer
396
views
I am getting error on ArrayAdapter saying that function does not exists
class ThirdFragment : Fragment() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.let {
}
}
override fun onCreateView(
inflater: ...
0
votes
1
answer
542
views
How to retrieve an object from firebase database?
I'm trying to retrieve an object from an ArrayList in the database but when I'm retrieving it one of the object attributes returns an empty string instead of the string saved in the database, however, ...
1
vote
1
answer
122
views
The spinner is empty when no new object is being generated for an ArrayAdapter
To assign data of an ArrayList<String> alKategorien to a spinner auswahl_kategorie, I am using this snippet:
ad = new ArrayAdapter(
this,
android.R.layout.simple_spinner_item,
...
0
votes
0
answers
773
views
Using list view and array adapter in android studio
I am a beginner in Android studio and I am trying to send an array list to a list view. I know that I am passing the correct info from my main activity to the second activity and that it is received ...
0
votes
1
answer
453
views
change text color of singel item in arrayAdapter
I have a TextInputLayout with an AutoCompleteTextView in it
I learned from materials prencebels that the style :
style="@style/Widget.MaterialComponents.TextInputLayout....
0
votes
0
answers
523
views
Callback from an adapter to a function inside fragment
My adapter callback is not working.
I want to activate an alert dialog to pop up after the user clicks on one of the cards in recycle view. To implement the same I followed this answer. During runtime,...
0
votes
1
answer
31
views
I have a ListView populated adata from SQLite. I am trying to add an onClickListener to each row to pass it to the next activity
I am a bit stuck I want to be able to pass the selected row and display it in another activity...
I have the following code that queries the database and fills the listview, but I can't find the way ...