Questions tagged [android-viewbinder]

The ViewBinder is an Android class that can be used with an adapter to modify(or enhance) the way that adapter binds its data to its views.

The Android ViewBinder is designed to work with various types of adapters(like SimpleAdapter, SimpleCursorAdpter etc). This class should be used to either enable the adapter to bind data to views it doesn't support or to modify the way the adapter currently binds its data. The proper usage of a ViewBinder is to implement its setViewValue() method and then register it with the adapter(through the adapter's setViewBinder() method).

94 questions
0
votes
1 answer

Display text and image from database with SimpleCursorAdapter.ViewBinder

I show the data from database like text and image, but my code is not working. I use this tutorial for my project. This my java class: public class PepakPostView extends ListActivity { protected TextView postOne; protected TextView…
0
votes
1 answer

ViewBinder setViewValue for ListView item leads to multiple CheckBoxes checked

I'm using a ListView which has: list item click CheckBox click I can save the cursorPosition by using view.setTag(cursor.getPosition()) and I can take necessary action on the checked item but when I scroll down, I see several other CheckBoxes…
Taranfx
  • 10,361
  • 17
  • 77
  • 95
0
votes
1 answer

How to update non-bound child view for ALL items in a ListView?

I have a ListView that uses a custom layout that has 5 child View objects (4 TextView and 1 CheckBox) in the custom layout. Only the TextViews are bound, however - the CheckBox has no corresponding field in the database. The purpose of the…
0
votes
1 answer

Conditional action in ViewBinder

I wish to disable a line item for my ListView (using SimpleCursorAdapter with ViewBinder), but it doesn't work: public boolean setViewValue(View view, final Cursor cursor, int columnIndex) { int viewId = view.getId(); switch (viewId)…
Taranfx
  • 10,361
  • 17
  • 77
  • 95
0
votes
1 answer

View binding not working, what did I miss?

I am following the Android Kotlin course on Udacity which suggested to use viewbinding instead of findViewById(). However, I am trying to use it and the text in my application does not update. I've tried to rebuild the app and I have added…
0
votes
1 answer

ListView and remembering data

I have some problems with a ListView(it's more of a visual problem), it remembers data such as text values from TextViews, from the ListView's rows, but tangles or forgets aspects regarding the TextViews background color. The problem shows up only…
0
votes
1 answer

Why data not pass from xml to Activity?

In my android app: dataBinding { enabled = true } in my activity: class RegistrationActivity : RootActivity() { private lateinit var viewBinding: RegistrationActivityBinding // use "registration_activity.xml" private lateinit var…
Alexei
  • 14,350
  • 37
  • 121
  • 240
0
votes
3 answers

Can I change the background of a LinearLayout from a ListView row in the ViewBinder?

I have a ListView with some elements and I want to change the background of the row depending on their type in the database. What I got is a SimpleCursorAdapter instance and it's function adapter.setViewBinder(...). But it seems, that I can't access…
Johannes Klauß
  • 10,676
  • 16
  • 68
  • 122
0
votes
1 answer

Accessing objects dynamically created with an adapter

I've created a dynamic ListView with TextViews and Spinners, using a SimpleAdapter and a ViewBinder. How can I access a Spinner value after the user had selected it? I think I need to create references to the spinners inside my ViewBinder, but I…
0
votes
1 answer

Is it safe to call the View.post(runnable) method in the main thread?

I've got a view in a RecyclerView. And I call myView.post(runnable) in onBindViewHolder() method to gather information about myView after the layout pass finishes. Is there any risk of crashing my application if the host activity gets destroyed…
0
votes
1 answer

Data in Adapter but not loding in Listview | converted Listactivity to ListFragment

I have converted Many Activities to Fragment, all are working fine except one. In the Previous version of this java file, it was extending ListActivity, now I have replaced it with ListFragment. Initially it was giving a nullPointerException, but…
0
votes
0 answers

android change listview image source base on status

trying to change a listView image item source depend on a field eg: if (status === 1) show red image else show green image. I tried a view binder with Simple Cursor Adapter, But that do nothing also not showing any error private class MyViewBinder…
0
votes
2 answers

A switch in my bindView is not running the expected cases

I am trying to populate a list list with an ImageView, and three TextViews from an SQLite database. The data in the TextViews is what i expect it to be, but the ImageView never changes. The ImageView is supposed to swap between two icons depending…
0
votes
1 answer

Android ViewBinder values from cursor

Hoping someone can help me here. I have a layout which contains listview, each item in the list view contains individual text fields to represent the days of the week --> SMTWTFS What I am trying to do is change the colour of the text items if they…
0
votes
1 answer

Android ImageButton in ListView row clicklistener not responding

I have a ListView with rows that contain ImageButtons (shown as 'O' below): [<-------TextView-------> O O O] [<-------TextView-------> O O O] I am finding that the first row has intermittent behaviour. At first it appeared that the image button…