#Region Project Attributes
#ApplicationLabel: DITL CastToTV
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private xui As XUI
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
Private btnCast As Button
Private ImageView1 As ImageView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout")
'btnCast.Initialize("btnCast")
End Sub
Sub btnCast_Click
Dim i As Intent
i.Initialize("android.settings.CAST_SETTINGS", "")
Try
StartActivity(i)
Catch
Try
i.Initialize("android.settings.WIRELESS_SETTINGS","")
StartActivity(i)
ToastMessageShow("Please select Cast/Screen Mirroring",True)
Catch
ToastMessageShow("Casting not supported on this device",True)
Log(LastException)
End Try
End Try
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
xui.MsgboxAsync("Hello world!", "B4X")
End Sub
{/code]