Alberto Michelis Well-Known Member Licensed User Longtime User Jul 29, 2015 #1 Hi, Im using Service.StartForeground in my service. As noted in the other Threads I code: Code: Copy snotif.Initialize snotif.Icon = "logo.png" snotif.SetInfo2("TITLE","SUB_TITLE",0,mDashboard) snotif.Sound = False snotif.Notify(1) Service.StartForeground(1,snotif) And there are two weird results. -When the service is started, the icon is OK but the "TITLE" is replaced by the app name and the "SUB_TITLE" by "Touch to obtain more information..." and if you touch you are redirected to the Android app form from where you can Stop and Unistall and etc... -The other weird behavior is that when you lunch a real notification from your app these initial service notification is replaced by the new notification, it works ok touching it and going to the activity I want but... stays with the title and subtitle of the last notification and cant be deleted from the notification pad. Then been confusing to the user. Tested using SetInfo and Setinfo2 Am I doing somethig wrong? Android 4.3 Last edited: Jul 29, 2015
Hi, Im using Service.StartForeground in my service. As noted in the other Threads I code: Code: Copy snotif.Initialize snotif.Icon = "logo.png" snotif.SetInfo2("TITLE","SUB_TITLE",0,mDashboard) snotif.Sound = False snotif.Notify(1) Service.StartForeground(1,snotif) And there are two weird results. -When the service is started, the icon is OK but the "TITLE" is replaced by the app name and the "SUB_TITLE" by "Touch to obtain more information..." and if you touch you are redirected to the Android app form from where you can Stop and Unistall and etc... -The other weird behavior is that when you lunch a real notification from your app these initial service notification is replaced by the new notification, it works ok touching it and going to the activity I want but... stays with the title and subtitle of the last notification and cant be deleted from the notification pad. Then been confusing to the user. Tested using SetInfo and Setinfo2 Am I doing somethig wrong? Android 4.3
DonManfred Expert Licensed User Longtime User Jul 29, 2015 #2 Alberto Michelis said: I think it is still the service runnig notification Click to expand... correct i cant answer more sorry. Upvote 0
Alberto Michelis said: I think it is still the service runnig notification Click to expand... correct i cant answer more sorry.
Erel B4X founder Staff member Licensed User Longtime User Jul 30, 2015 #3 1. You shouldn't call snotif.Notify. 2. Make sure that any other notification created in your app uses a different id. Upvote 0
1. You shouldn't call snotif.Notify. 2. Make sure that any other notification created in your app uses a different id.
Alberto Michelis Well-Known Member Licensed User Longtime User Jul 30, 2015 #4 1- I delete the snotif.Notify and nothig changes, still replacing Title and Subtitle and going to the Stop-Unistall Android page. 2- All my notification has its own ID FWIW Im doing this in the first line of Service_Create I've added this lines to the begginig of the Service_Start, trying to reproduce the problem 2 and then fix the title and subtitle: Code: Copy Dim snot As Notification snot.Initialize snot.Icon = "logo.png" snot.Sound = False snot.Vibrate = False snot.SetInfo2("PortIt","Servicio de Lectura",0,mDashboard) snot.Notify(1) And the result is the Notification is gone!! All subsecuent notification works ok. Upvote 0
1- I delete the snotif.Notify and nothig changes, still replacing Title and Subtitle and going to the Stop-Unistall Android page. 2- All my notification has its own ID FWIW Im doing this in the first line of Service_Create I've added this lines to the begginig of the Service_Start, trying to reproduce the problem 2 and then fix the title and subtitle: Code: Copy Dim snot As Notification snot.Initialize snot.Icon = "logo.png" snot.Sound = False snot.Vibrate = False snot.SetInfo2("PortIt","Servicio de Lectura",0,mDashboard) snot.Notify(1) And the result is the Notification is gone!! All subsecuent notification works ok.
Erel B4X founder Staff member Licensed User Longtime User Jul 30, 2015 #5 Please create a small program that demonstrates this issue and upload it. Upvote 0
Alberto Michelis Well-Known Member Licensed User Longtime User Jul 30, 2015 #6 Here it goes... Attachments ServiceExample.zip ServiceExample.zip 10 KB · Views: 611 Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jul 30, 2015 #7 You haven't set the Icon property correctly. It should point to an image from the drawable folder and it shouldn't include the file extension: Code: Copy snotif.Icon = "icon" Upvote 0
You haven't set the Icon property correctly. It should point to an image from the drawable folder and it shouldn't include the file extension: Code: Copy snotif.Icon = "icon"
Alberto Michelis Well-Known Member Licensed User Longtime User Jul 30, 2015 #8 Done, same problem... Attachments ServiceExample.zip ServiceExample.zip 26.7 KB · Views: 598 Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jul 30, 2015 #9 You still haven't set the icon property correctly. Please go over the code more carefully. Upvote 0
DonManfred Expert Licensed User Longtime User Jul 30, 2015 #10 Alberto Michelis said: Done, same problem... Click to expand... Code: Copy Sub Service_Create snotif.Initialize snotif.Icon = "logo" but there is no logo.png in your drawable folder Upvote 0
Alberto Michelis said: Done, same problem... Click to expand... Code: Copy Sub Service_Create snotif.Initialize snotif.Icon = "logo" but there is no logo.png in your drawable folder
Alberto Michelis Well-Known Member Licensed User Longtime User Jul 30, 2015 #11 I see it ok... the logo.png is in the Files folder... whats wrong? Attachments logo.png 32.7 KB · Views: 626 Upvote 0
DonManfred Expert Licensed User Longtime User Jul 30, 2015 #12 Alberto Michelis said: whats wrong? Click to expand... You do not read correctly! DonManfred said: but there is no logo.png in your drawable folder Click to expand... Erel said: It should point to an image from the drawable folder Click to expand... Files folder is NOT the drawable-folder! Objects\res\drawable is the drawables-folder. Note to set the files in this folder must be set to read-only to be not removed when compiling. Or use an additional-resource folder Upvote 0
Alberto Michelis said: whats wrong? Click to expand... You do not read correctly! DonManfred said: but there is no logo.png in your drawable folder Click to expand... Erel said: It should point to an image from the drawable folder Click to expand... Files folder is NOT the drawable-folder! Objects\res\drawable is the drawables-folder. Note to set the files in this folder must be set to read-only to be not removed when compiling. Or use an additional-resource folder
Alberto Michelis Well-Known Member Licensed User Longtime User Jul 30, 2015 #13 Sory, because in my original app I saw the correct icon I thought it is ok for it to be in the files folder. Upvote 0
Sory, because in my original app I saw the correct icon I thought it is ok for it to be in the files folder.
DonManfred Expert Licensed User Longtime User Jul 30, 2015 #14 Look in <your drawable folder. The is only a icon.png... so notif.icon = "icon" should work for THIS png... Upvote 0
Look in <your drawable folder. The is only a icon.png... so notif.icon = "icon" should work for THIS png...
Alberto Michelis Well-Known Member Licensed User Longtime User Jul 30, 2015 #15 Thanks you all!!! Upvote 0
Alberto Michelis Well-Known Member Licensed User Longtime User Jul 31, 2015 #16 Hi, now Im having problems with Code: Copy snot.SetInfo2("PortIt","Servicio de Lectura",0,mDashboard) mDashboard is the 2nd activity that is called by Main when the app starts, the app never comes back to Main. If I use this code when I use the app and goes back and forth into the app activities, if I click in the notification sometimes it does not works well, it crashes or loose variables.. If I code like Code: Copy snot.SetInfo2("PortIt","Servicio de Lectura",0,"") nothing happesn and all is ok Is the any thing I can replace mDashboard to make the app to open in the actual activity? Thanks Upvote 0
Hi, now Im having problems with Code: Copy snot.SetInfo2("PortIt","Servicio de Lectura",0,mDashboard) mDashboard is the 2nd activity that is called by Main when the app starts, the app never comes back to Main. If I use this code when I use the app and goes back and forth into the app activities, if I click in the notification sometimes it does not works well, it crashes or loose variables.. If I code like Code: Copy snot.SetInfo2("PortIt","Servicio de Lectura",0,"") nothing happesn and all is ok Is the any thing I can replace mDashboard to make the app to open in the actual activity? Thanks
Erel B4X founder Staff member Licensed User Longtime User Aug 2, 2015 #17 Please start a new thread for a new question. Upvote 0