Android Question How to start another activity when Replacing Notification by NB6

Alain75

Member
I used the simple notification builder and passed an intent in the setinfo2 activity parameter in order to start another application when clicking the notification.

SetInfo2 of Notification:
dim notif as Notification, pm as PackageManager
...
notif.SetInfo2("Title","Text","",pm.GetApplicationIntent(xxx))

I want to switch to NB6 because It would be great to show the icon of the other application with the LargeIcon. I thaught that NB6 will react as Notification when passing the intent in the activity parameter of the build method.

Build of NB6:
dim notif as NB6, pm as PackageManager
...
notif.Build("Title","Text","",pm.GetApplicationIntent(xxx))

Unfortunately, it crashs with error :
B4X:
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Class.getName()' on a null object reference

I tried the same approach passing intent in activity parameter of method AddButtonAction2 but with more or less he same problem...

Instead of Me, what should be the activity parameter to launch another application from the notification click ?
Thanks
 

AnandGupta

Expert
Licensed User
Longtime User
@AnandGupta Do you mean that I should fix NB6 Library myself and upload it ? I think I identified the proper way do it but it's not mine...
Thanks

Android part of my web site: android section
My chrome extension: extension section
I mean, you can upload your changed lib with different name here, as is done by many members.
Erel has to follow some rules and may not be specific to ones need. But he allows us to modify the libs as we require.
 
Upvote 0
Top