Android Question Notification Setinfo No Longer calls activity

MrKim

Well-Known Member
Licensed User
Longtime User
After a week of fiddling around trying to figure out why code that used to work no longer works I think maybe there is bug in Setinfo. I finally tried (Discovered) Setinfo2 it works fine. Setinfo does not call my activity but Setinfo2 does.

In order to test this I have created a stripped down test program. Which I have included. If I have simply missed something I would like to know.

B4X:
Sub Process_Globals
    Dim NTF As Notification

End Sub
Sub Service_Create

End Sub

Sub Service_Start (StartingIntent As Intent)

Try

        NTF.Initialize
        NTF.Cancel(1)
        NTF.AutoCancel=True
        NTF.Icon="nag36x36"
        NTF.Vibrate= False
        NTF.Sound = False
'        NTF.SetInfo("Nag", "Stop Nagging!", StopNagging2)  'Doesn't Work
        NTF.SetInfo2("Nag", "Stop Nagging!", "", StopNagging2)  'Works
        NTF.Notify(1)

Catch
    ToastMessageShow("SetNag Service_Start Error" & CRLF & LastException.Message,True)
End Try

End Sub

Oh, one other thing, SetInfo works SOMETIMES! For example When I copied my program to create DoesntWork, stripped everything out and compiled it, it worked. The next day I compiled it in debug to see exactly what was happening compared to my full program and it no longer worked. Debug OR full compile. The reason I am using StopNagging2 is because when StopNagging stopped working in desperation I thought perhaps the file was corrupt. I created StopNagging2, copied in the code from StopNagging and it worked - for a while.

I am testing on a Samsung Note 2. Android Version 4.4.2.

Thanks in advance for any help.

Kim
 

Attachments

  • TestDoesntWork.zip
    73.9 KB · Views: 225
Last edited:

MrKim

Well-Known Member
Licensed User
Longtime User
OK, well now I think I have a lead. Setinfo2 has also stopped working even on my simple test app. The common thread seems to be that if you UNINSTALL THE PROGRAM and then reinstall it then the Activity is no longer called by the Notification!!!???
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
AAAAAND - REBOOTING the phone and it starts working again. So there is a bug somewhere.

I just confirmed this. If I UNINSTALL my app and then reinstall, a reboot is required in order for the notification to call my Activity. If I install an UPDATE without uninstalling then things continue to work as they should.

I would like to know if this is a B4A issue or an Android/Samsung issue so any feedback is welcome.

Or perhaps there is a way to code around this problem?

Kim
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
Please use File - Export as zip when uploading projects to the forum.

It sounds like an Android bug. If you like try to reproduce it in a smaller project and upload the project.

Sorry about that I re-uploaded the file after zipping as prescribed.
 
Upvote 0
Top