Android Question service start foreground ?

Discussion in 'Android Questions' started by Devv, Apr 2, 2015.

  1. Devv

    Devv Active Member Licensed User

    i'am using this code

    Code:
    Dim test As Notification
        test.Initialize
        test.SetInfo(
    "title","body",Main)
        
    Service.StartForeground(1,test)
    it is not changing the notification title and body and when i click it it take me to the app information not to the main activity
    what i'am doing wrong ?

    another question is ,can i make the notification hidden or with no title and body ?
     
  2. DonManfred

    DonManfred Expert Licensed User

    You forgot to call notify i believe... Give it a try
    [​IMG]
     
    thedesolatesoul likes this.
  3. Devv

    Devv Active Member Licensed User

    still the same


    Code:
    Dim test As Notification
        test.Initialize
        test.SetInfo(
    "title","body",Main)
        test.Notify(
    2)
        
    Service.StartForeground(1,test)
     
  4. Mahares

    Mahares Well Known Member Licensed User

    On one line you have 1 and the other line you have 2. I think both should be the same.
     
    mangojack likes this.
  5. Erel

    Erel Administrator Staff Member Licensed User

    You shouldn't call test.Notify at all. It happens automatically when you call StartForeground. Are you creating any other notification in your app?
     
    Devv likes this.
  6. Devv

    Devv Active Member Licensed User

    no. the project only have that code
     

    Attached Files:

  7. Erel

    Erel Administrator Staff Member Licensed User

    You must set the icon property:
    Code:
    Dim test As Notification
      test.Initialize
       test.Icon = 
    "icon"
      test.SetInfo(
    "title","body",Main)
      
    Service.StartForeground(1,test)
     
    thedesolatesoul and Devv like this.
  8. Devv

    Devv Active Member Licensed User

    Thanx erel
     
  9. Devv

    Devv Active Member Licensed User

    is their is a way to hide the time that appears on the right of the notification ?
    and how could i control if the notification appears at the top or at the bottom of other notifications ?
     
  10. Peter Simpson

    Peter Simpson Expert Licensed User

    No and no as far as I know...
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice