I am currently working on a project that requires me to get the address using reverse geocode. I am able to get the data from the URL but keep getting an error as follows. Would be great if i can get a solution to this problem. Thanks!
“12-19 03:01:54.419 5088-5088/com.junjie.retrofit_location E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.junjie.retrofit_location, PID: 5088
java.lang.NullPointerException: Attempt to invoke virtual method ‘int java.util.ArrayList.size()’ on a null object reference
at com.junjie.retrofit_location.MainActivity$1.onResponse(MainActivity.java:61)
at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:70)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)”