Hi guys I made some very simple radio app but need help with one thing
I need the radio app to pause(sound), when Incoming call.
Test my app here
http://www.b4x.com/forum/test-my-app/26229-test-my-first-radio-online.html
I need the radio app to pause(sound), when Incoming call.
B4X:
#Region Module Attributes
#FullScreen: True
#IncludeTitle: False
#ApplicationLabel: Radio Prime Halden
#VersionCode: 1
#VersionName:
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#End Region
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim Url As String
Dim b As MediaPlayerStream
Dim Label1 As Label
'Dim WebView1 As WebView
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Activity.LoadLayout("view")
'WebView1.LoadUrl("http://www2.radioprime.com/webradio/index.php?stasjon=halden")
If FirstTime Then
b.Initialize("b")
End If
b.Load("http://primestream.monsternett.no:8000/prime.mp3")
Label1.Width = 100%x
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
b.Play
End Sub
Sub Button2_Click
b.Pause
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event
If KeyCode = KeyCodes.KEYCODE_BACK Then
If Msgbox2("Vil du lukke programmet?", "", "Ja", "Avbryte", "Nei", Null) = DialogResponse.POSITIVE Then
' Return False
ExitApplication 'App is exiting
Else
Return True
End If
End If
End Sub
Test my app here
http://www.b4x.com/forum/test-my-app/26229-test-my-first-radio-online.html