AdvancedAndroid_Shushme icon indicating copy to clipboard operation
AdvancedAndroid_Shushme copied to clipboard

place.getAddress().toString on a Null Pointer Reference

Open Narutuffy opened this issue 8 years ago • 3 comments

In the branch T0X.03-Solution-GetPlaceById, whenever a location is selected the app crashes saying 07-01 07:32:45.813 1528-1528/com.example.android.shushme E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.android.shushme, PID: 1528 java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { (has extras) }} to activity {com.example.android.shushme/com.example.android.shushme.MainActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String java.lang.CharSequence.toString()' on a null object reference at android.app.ActivityThread.deliverResults(ActivityThread.java:3659) at android.app.ActivityThread.handleSendResult(ActivityThread.java:3702) at android.app.ActivityThread.access$1300(ActivityThread.java:155) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1366) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5343) 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:905) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700) Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String java.lang.CharSequence.toString()' on a null object reference at com.example.android.shushme.MainActivity.onActivityResult(MainActivity.java:172) at android.app.Activity.dispatchActivityResult(Activity.java:6218) at android.app.ActivityThread.deliverResults(ActivityThread.java:3655) at android.app.ActivityThread.handleSendResult(ActivityThread.java:3702)  at android.app.ActivityThread.access$1300(ActivityThread.java:155)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1366)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5343)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372) 

Narutuffy avatar Jul 01 '17 02:07 Narutuffy

Yes, this is happening to me. What is the solution to that problem?

mohamedesam93 avatar Jun 05 '18 11:06 mohamedesam93

did you get the solution

thrwatzidan avatar Aug 24 '18 16:08 thrwatzidan

yes, thanks for you

mohamedesam93 avatar Aug 25 '18 00:08 mohamedesam93