DEV Community

Discussion on: I'm an Android Developer(Java/Kotlin), pre-middle level, Ask Me Anything!

Collapse
 
devit951 profile image
Ildarov • Edited

Hello!
You can read this article and this.

Collapse
 
kasali profile image
Salif KA

Hello Dear friend!
Thankyou for your help!
I want implement the architures components, i have already do the part of the local Backend(ROOM).I across a problem with the remote backend(retrofit)!
Please help me!
Thanks!

Thread Thread
 
devit951 profile image
Ildarov

What's the problem?

Thread Thread
 
kasali profile image
Salif KA

this is the result from the Logcat:Attempt to invoke virtual method 'void android.arch.lifecycle.LiveData.observe(android.arch.lifecycle.LifecycleOwner, android.arch.lifecycle.Observer)' on a null object reference!

Thread Thread
 
devit951 profile image
Ildarov

To help you I need more information. Can you paste your code to gist.github.com/
and tell me in which line of code you got this exception.

Thread Thread
 
kasali profile image
Salif KA

I have pasted.This is the link:
gist.github.com/kasali/fd6f42a8523...

Thread Thread
 
devit951 profile image
Ildarov

Seems like your user variable returned by getUser() method is null. Did you initialize it?

Thread Thread
 
kasali profile image
Salif KA

Yes i have initialise !
code in the Viewmodel Class:
public LiveData getUser(String username, String mdp)

{
return userrepository.getUser(username,mdp);
}