Questions tagged [android-databinding]

Data Binding Library to write declarative layouts and minimize the glue code necessary to bind your application logic and layouts.The Data Binding Library offers both flexibility and broad compatibility — it's a support library, so you can use it with all Android platform versions back to ...

0
votes
0answers
13 views

Android MVVM BindingClass does not generate the full path of ViewModel

In my implementation of MVVM pattern, I have encountered the followingAbove is my Activity class trying to bind with the viewModel in the layout fileAbove is the related XMLNote : The path of ...
0
votes
3answers
31 views

Datepicker on button after click

I am looking for a solution to my problem. I want to make button in activity and after click I want to display date picker. How to do it in databindind? Any bind adapter?
0
votes
0answers
13 views

Databinding, Binding class can't find RealmObjects

I was using databinding with realm objects and after updating android studio and gradle the auto generated Binding classes can't find the RealmDb classes or directory.I tried removing the realm ...
0
votes
1answer
44 views

two-way databinding

I have a problem with two-way databindig. Here are my classes:public class User extends BaseObservable {private String name;private String surname;private Address address;public User() {}...
0
votes
1answer
15 views

Databinding and included layouts: Cannot find setter attribute for onClick

I'm trying to set an OnClickListener for an <include>d layout, but receive a data binding error at compile time stating that data binding "Cannot find the setter for attribute 'android:onClick' ...
0
votes
2answers
48 views

How to pass the current view to a called method of the view model?

I need to trim a text in my TextInputEditText after its text was changed. In short I need a something like this: <com.google.android.material.textfield.TextInputEditTextandroid:layout_width=...
0
votes
2answers
27 views

Updating UI using ViewModel and DataBinding

I am trying learn View-model android ,in my first phase of learning i am trying to update UI (Textview) by using view-model and data-binding. In View model i am having aynctask callback and it will ...
0
votes
1answer
19 views

Toggle visibility of custom view in XML via Databinding

I have a fragment layout fragment_config.xml, which cointains the following: <?xml version="1.0" encoding="utf-8"?><layout xmlns:bind="http://schemas.android.com/tools"><data>...
0
votes
0answers
29 views

When using MVVM pattern in Android, do I have to use Databinding??

I have a question in Android about architecture.When using MVVM pattern in Android, do I have to use Databinding??
-1
votes
3answers
57 views

Confusion over MVVM and two way Data Binding

I am trying to create a simple "Log in" screen using the MVVM pattern. I have two-way data binding between my View and a Model class, but what does that leave for the ViewModel to do?Originally I ...
0
votes
0answers
20 views

Android Databinding Error for Multiple Layout files

I am getting an error on using with android datat binding libreryi have successfully compleated one layout it working.but i created new layout and add <layout> tag in new .xml and Build->...
0
votes
0answers
12 views

How can I get Observable field for Custom View in ViewModel?

Hey everyone, Is it possible to get an Observable for a custom view in my ViewModel class?Custom view is country picker from here: https://github.com/hbb20/CountryCodePickerProjectMaybe there ...
0
votes
1answer
35 views

Kotlin android extensions in custom view with databinding

I have a Custom Linear layout and an xml file in with 3 checkboxes. The Custom linear layout looks roughly like this: class AdvancedBox : LinearLayout, DefineExchangesDialog....
0
votes
0answers
9 views

Could not find accessor to included View in layout data binding android

I have a main layout main.xml and another layout custom.xml which is included in the main.xml layout. E.g. main.xml<layout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="...
2
votes
0answers
91 views

Issue with data binding with gradle 3.2.1

When i have updated android studios 3.2.0 to 3.2.1. I have use data binding, when run project show me error like this, if i am wrong please suggest me.Could not find com.android.databinding:compiler:...
1
vote
0answers
38 views

Android Data Binding Cannot Find Package

I just updated my Android Studio to 3.2.1. Now, my data binding doesn't work at all. I have a package where I store my data classes e.g Profile. In the data binding generated class, where there is an ...
0
votes
0answers
24 views

Generated ViewDataBinding class in Android Studio 3.2.1 has an error when view layout data variable type is contained in a subpackage

I have my viewmodels contained in a "ViewModels" package. When setting one of them as a data variable type in my fragment layout xml file the generated ViewDataBinding class attempts to import the ...
0
votes
1answer
27 views

ViewModel onCleared not called in RecyclerView

I have an adapter with code below. The problem is, that the onCleared()-Method of the ViewModel seems never being called for the ViewModels for the list items.Is there a special method / flag that ...
0
votes
1answer
55 views

Android RecyclerView “cannot find symbol variable”

My problem is that I am writing a program which contains 2 RecyclerViews in 2 different activities. The first one worked like a charm. No troubles at all. The second one, on the other hand, is not ...
1
vote
2answers
115 views

Can't resolve androidx.databinding

I'm trying to migrate my app to AndroidX, following the official doc.I run the refactor option: migrate to AndroidX.At first I had errors that has been resolved by restarting and cleaning my ...
0
votes
3answers
81 views

Cannot find the getter for attribute ImageView while using Databinding in kotlin

I am trying to learn data binding with Kotlin and I was able to implement it successfully for edit text and text views. After that I am trying to use it for Image Views. I am currently trying to give ...
0
votes
1answer
27 views

AlertDialog gets reshown on orientation change

Code for question on GithubI have a app which is using fragments + viewmodels. In one fragment I need to present a list of options to the user when they hit a button. I'm doing this using an ...
0
votes
1answer
27 views

Data binding - access individual properties contained in LiveData

Is there a way to do something like this with LiveData and data binding?ViewModel has this property:val weather: LiveData<UnitSpecificCurrentWeatherEntry>What I'm trying to do in the ...
0
votes
0answers
38 views

BaseActivity mvvm architecture android, viewmodel not initialized

I am trying to write a base activity with code like thisabstract class BaseActivity<T : ViewDataBinding, V : BaseViewModel> : AppCompatActivity(), HasSupportFragmentInjector {val ...
0
votes
1answer
28 views

Android Data Binding with parameter passing to method

First, this question is not a case of 'onClick' event parameter passing.I have DateUtil class with one method as below : public static String formatDate(long date) {SimpleDateFormat ...
0
votes
1answer
37 views

Android databinding setText() over model binding

In my xml I have a line android:text='@{entry.printTitle}'In my adapter I set entry: binding.setEntry(item); in bind() method. For some occasions I want to set that field manually with binding....
1
vote
1answer
42 views

How can I pass onClickListener to <include> tag?

A layout to be include is like this, child.xml:<layout><data><variablename="click"type=""> <!-- What type should be here? --&...
0
votes
1answer
33 views

Cannot invoke method data Binding() on null object, while adding dataBinding in Gradle

I searched in stackoverflow a lot i cant find a solution to this particular issue,i addeddataBinding {enabled=true}inside the android{} and also android support repository is ...
2
votes
0answers
149 views

Issues when upgrading support library to v28 or androidx

I am working on an Android project where I use:com.android.tools.build:gradle 3.1.3org.jetbrains.kotlin:kotlin-gradle-plugin 1.2.50com.google.gms:google-services 3.2.0compileSdkVersion 27...
0
votes
0answers
81 views

Data binding with Kotlin: ProcessDataBinding Unable to get public no-arg constructor

I get this error when I type http://stackoverflow.com/gradlew test in the command line:e: java.util.ServiceConfigurationError: javax.annotation.processing.Processor: android.databinding.annotationprocessor....

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,