'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
'Dialog Icons
Type b4aIconsType ( _
alert As String, alertDark As String, alertLight As String, closeNormal As String, _
closePressed As String, dialer As String, email As String, focused As String, _
info As String, Map As String, menu As String, time As String, usb As String )
Dim b4aIcons As b4aIconsType
b4aIcons.alert="ic_dialog_alert"
b4aIcons.alertDark="ic_dialog_alert_holo_dark"
b4aIcons.alertLight="ic_dialog_alert_holo_light"
b4aIcons.closeNormal="ic_dialog_close_normal_holo"
b4aIcons.closePressed="ic_dialog_close_pressed_holo"
b4aIcons.dialer="ic_dialog_dialer"
b4aIcons.email="ic_dialog_email"
b4aIcons.focused="ic_dialog_focused_holo"
b4aIcons.info="ic_dialog_info"
b4aIcons.map = "ic_dialog_map"
b4aIcons.menu="ic_dialog_menu_generic"
b4aIcons.time="ic_dialog_time"
b4aIcons.usb="ic_dialog_usb"
Dim andResource As AndroidResources
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 EditText1 As EditText
Dim ImageView1 As ImageView
Dim Label1 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button2_Click
msgbox4("Dialer Icon", "Title", "OK","Cancel","Retry", b4aIcons.dialer)
End Sub
Sub msgbox4(mbMsg As String, mbTitle As String, mbPositive As String, mbCacnel As String, mbNegative As String, Icon As String) As Int
Dim BitmapDrawable1 As BitmapDrawable
Dim DrawableName As String
Dim Object1 As Object
Dim result As Int
Object1=andResource.GetAndroidDrawable(Icon)
' Object1 will now be Null or the requested Drawable
If Object1=Null Then
Log("Drawable NOT FOUND: "& Icon)
BitmapDrawable1=Null
ImageView1.Bitmap=Null
result = Msgbox2(mbMsg, mbTitle, mbPositive, mbCacnel, mbNegative, BitmapDrawable1.Bitmap)
Return result
Else
BitmapDrawable1=Object1
ImageView1.Bitmap=BitmapDrawable1.Bitmap
result = Msgbox2(mbMsg, mbTitle, mbPositive, mbCacnel, mbNegative, BitmapDrawable1.Bitmap)
Return result
End If
End Sub
Sub Button1_Click
Dim BitmapDrawable1 As BitmapDrawable
Dim DrawableName As String
Dim Object1 As Object
Object1=andResource.GetAndroidDrawable(b4aIcons.info)
' Object1 will now be Null or the requested Drawable
If Object1=Null Then
Log("Drawable NOT FOUND: "&DrawableName)
ImageView1.Bitmap=Null
Else
BitmapDrawable1=Object1
ImageView1.Bitmap=BitmapDrawable1.Bitmap
End If
End Sub