Android Question Crash in Java.util.list.com

Robert Valentino

Well-Known Member
Licensed User
Longtime User
One of my users had a crash yesterday
B4X:
~e:java.lang.NullPointerException: Attempt to invoke interface method 'java.util.List com.android.server.pm.pkg.component.ParsedMainComponent.getIntents()' on a null object reference
~e: at android.os.Parcel.createExceptionOrNull(Parcel.java:3017)
I believe the lines of code are:
B4X:
Dim GooglePlayStore As Intent
                                        
GooglePlayStore.Initialize(GooglePlayStore.ACTION_VIEW,  "https://play.google.com/store/apps/details?id=com.BOBs.BBS")
GooglePlayStore.SetComponent("android/com.android.internal.app.ResolverActivity")
                                            
StartActivity(GooglePlayStore)                                            
[/code}

Now, this code works on ALL my devices (has been working for years) and not had any other users crash.
There device is running 13 / 33 (pretty much same as a lot of my devices).
 

drgottjr

Expert
Licensed User
Longtime User
my guess in this case is that your user has no activity that handles the intent. that would throw a null, which you are
supposed to check for before starting a (non-existing) activity. there are plenty of posts relating to this topic.
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Thanks.
Strange the user wouldn't have Google Play Store. But will trap and start checking app has been installed from Google Play Store
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
documentation for the method reporting the error indicates that a list is returned. if uninitialized, you get your null object. documentation relating to what that method actually does goes on for quite a while. the user may have a particular app installed, but documentation suggests that the method may get hung up due to its complicated nature. does user report error still happening?
 
Upvote 0
Top