question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Kotlin: saving ObservableField state error

See original GitHub issue

Hi,

in Kotlin I have a field like this:

@State var email: ObservableField<String> = ObservableField()

When I try to compile the code I get an error like this:

Error:(57, 51) error: incompatible types: String cannot be converted to ObservableField<String>

And the affected generated code looks like this:

@Override
@SuppressWarnings("unchecked")
public void restore(T target, Bundle state) {
    target.setEmail(HELPER.<String>getSerializable(state, "Email"));
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
kanciccommented, Jun 21, 2017

It is working fine now with the updated library, thank you very much. 😃

On Wed, Jun 21, 2017 at 9:30 PM Ralf Wondratschek notifications@github.com wrote:

Okay, I have a fix ready. Can you give the following build a try?

repositories { jcenter()

maven {
    url 'https://oss.sonatype.org/content/repositories/snapshots/'
}

}

dependencies { compile ‘com.evernote:android-state:1.1.1-SNAPSHOT’ kapt ‘com.evernote:android-state-processor:1.1.1-SNAPSHOT’ }

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/evernote/android-state/issues/24#issuecomment-310181394, or mute the thread https://github.com/notifications/unsubscribe-auth/AKe4slJLI35QIHFxj69itmDCzdYW5BYjks5sGW87gaJpZM4OAspC .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Work with observable data objects | Android Developers
Observability refers to the capability of an object to notify others about changes in its data. The Data Binding Library allows you to...
Read more >
Databinding - ObservableField<String> not updating view
I'm using MVVM architectural pattern. When ViewModel receives callback with fetched data I set it up to an ObservableField. Unfortunately it ...
Read more >
Advanced Data Binding in Android: Observables
Learn how to use the Data Binding Library to bind UI elements in your XML layouts to data sources in your app using...
Read more >
Simplifying UI States with Kotlin Sealed Classes and Data ...
To expose this state to our Binding object, or any other necessary observers, we rely on an ObservableField . Once our data has...
Read more >
Binding Adapters and Observable Objects | by Oya Canlı
In Kotlin, you can write your binding adapters as extension functions as well. ... states of the progress bar, recyclerview and error image, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found