Questions tagged [android-adapter]

An Adapter object acts as a bridge between an AdapterView and the underlying data for that view.

An Adapter represents the connection between a View with some kind of data source. Adapters generally come in two flavors: those that represent array/list based data and those that represent Cursor based data.

  • The Adapter provides access to the data items.
  • The Adapter is also responsible for making a View for each item in the data set.

See Adapter reference for more information.

Tag Usage:

3159 questions
0
votes
1 answer

App has stopped while trying to open the second layout

Im creating an app for scheduling, and when I choose a date and press select for moving to the other layout for creating a task for this date, the app stops. This is my main: public class CalendarActivity extends AppCompatActivity { CalendarView…
0
votes
3 answers

Glide does't put image into imageView

I have next Adapter like this: class ChatAdapter(chatItems: List, context: MainActivity) : RecyclerView.Adapter() { private val items= chatItems private val context = context override…
0
votes
0 answers

Can't refresh ListView on Android. notifyDataSetChanged() isn't working

I'm trying to create a simple random number generator and everything works well, instead of updating the ListView when I generate new numbers. Array, Adapter and ListView are connected properly, cause if values are added to the array before…
0
votes
1 answer

Changing Spinner list content after item is selected Android

Is there a way to change the displayed list inside of the Spinner after selection. I have 2 Strings, English and Finnish and I want to first change their language when one is selected, secondly change their order when the other is selected. private…
0
votes
1 answer

cannot reslove symbol 'position'

I am writing an adapter class in which the get position is showing error: "Cannot resolve symbol 'position'" in onBindViewHolder. public class cat_adapter extends RecyclerView.Adapter { private List
0
votes
3 answers

How do I show full information when I click on a list item?

I have a recyclerview that shows the image and first name and phone number, how do I implement that when you click on the item opens detailed information about the contact (picture, first name, last name, number, email, notes) My adapter class…
0
votes
1 answer

Use not nullable fragment manager

I want to display my TabLayout in my fragment, but he want nullable supportFragmentManager: override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) val fragmentAdapter =…
Morozov
  • 3,411
  • 3
  • 25
  • 48
0
votes
2 answers

List view with custom adapter don't show all items

I am doing a project which consists of a list of students with assistance The problem is that when loading the List View not all the elements appear in it, only 2. what i wnat to show is a list view with 2 spinner and 1 textview on every text view…
Pol Linger
  • 13
  • 4
0
votes
2 answers

Passing ParseFile (Image) from adapter to another activity (SOLUTION)

I have been trying to pass the image (ParseFile type) from an adapter to another activity. Since its a ParseFile I could not use normal way like, (getIntent().getIntExtra("image", 0);), to retrieve the image into the activity. If you could point me…
0
votes
2 answers

I need to access adapter of listview from a background thread

I am working on a Chat app, and as the title says, I want to access adapter of ListView from a background thread to add new elements (messages) to it without creating new ListView and adapter instances because that leads to refresh the ListView and…
0
votes
1 answer

Java/Android: How do I randomly generate 12 objects from an array of 20 objects onto a GridView using an Adapter class?

I am new to Android development. I am currently working on an app and would like to generate 12 images randomly onto a grid using an Adapter class. I currently am able to generate a random number of images from the array onto a grid... but the…
star_code
  • 3
  • 1
0
votes
1 answer

Why isn't my app displaying the users from the database in my recyclerview?

Please let me know why exactly my recyclerview is not displaying the list of users int the user fragment. I am following this GitHub tutorial, but the problem is that they have used Firebase Realtime Database and I am using Firebase Firestore. I am…
user12516578
0
votes
1 answer

When Click Event, Auto Refresh Another Tabs from SQLite

I'm coding a simple app. I have 2 tabs w/ fragment. First tab listing all records from SQLite database and second tab listing only "Favourites". When I'm clicking imageView (its showing a star image) it means "add favourite", it's updating this…
0
votes
2 answers

RecyclerView Hangs while scrolling

I am creating a forum app. It has homepage like Facebook's Home Page. It contains posts which has videos and images. While I scroll my page it hangs a lot. I want to know how can I make it smooth as Facebook's Homepage. Please help. Adapter Code:…
0
votes
1 answer

Do something after volley request is processed

I was working on parsing the nested JSON objects using Volley and I got the answer from the stackoverflow itself. Parsing Nested JSON Objects using Volley But I think the code can be optimized without the if else and also I have to display a text…
1 2 3
99
100