Android Question sendBroadcast & sendOrderedBroadcast

Discussion in 'Android Questions' started by b4auser1, Mar 25, 2015.

  1. b4auser1

    b4auser1 Well-Known Member Licensed User

    How to use these methods in the B4A ?
    The BroadcastReceiver library doesnt allow to pass Intent to these methods :(
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You can use Phone.SendBroadcastIntent to broadcast an intend. If you need to call sendOrderedBroadcast then it can be done with JavaObject.
     
  3. b4auser1

    b4auser1 Well-Known Member Licensed User

    Thank you.
    Could you provide with code snippet to call sendOrderedBroadcast using JavaObject ?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Code:
    Sub Activity_Create(FirstTime As Boolean)
       
    Dim jo As JavaObject
       jo.InitializeContext
       
    Dim i As Intent
       i.Initialize(...)
       jo.RunMethod(
    "SendOrderedBroadcast"Array(i))
    End Sub

    #If JAVA
    import android.content.*;
       public void SendOrderedBroadcast(Intent intent) {
         this.sendOrderedBroadcast(intent, null);
       }
    #end if
     
  5. b4auser1

    b4auser1 Well-Known Member Licensed User

    Thank you very much !
     
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