I am trying to write an android version of my probability calculator previously shared in the b4ppc forum. This program requires me to manipulate the visibility of certain labels and text fields, and to change the graphic displayed in an imageview.
I have had success in changing the visibility of buttons, radiobuttons, and panels but have had no success in changing the visibility of labels or edittext. Also, no success at loading a bitmap into the imageview.
I must be missing something basic here, but I have been trying for hours now with no progress. For example,
in Sub Globals I have
Dim df1Lbl AsLabel
in Sub Activity_Create(FirstTime AsBoolean) I have
df1lbl.Initialize("df1lbl")
But when in code, I have
df1Lbl.Visible = False
nothing happens (i.e., the label remains visible).
For the imageview I have
in Sub Globals
Dim DistImg AsImageView
in Sub Activity_Create(FirstTime AsBoolean)
DistImg.Initialize ("DistImg")
in code
DistImg.Bitmap = LoadBitmap(File.DirAssets, "tdist2.jpg")
does not load the bitmap.
I am testing the code in the emulator and receive no error messages. I have attached the zip file for the infant project. Pressing the button Command1 (1st button on left) demonstrates the behaviors mentioned above. Here is the code for Command1:
Sub Command1_Click
'The button (Command2) and RadioButton (RadioButton2) become invisible.
'The label (DF1Lbl) and EditText (DF1Text) do NOT become invisible.
'The imageview (hourglass) does NOT become visible
'the imageview (DistImg) does NOT load the new bitmap
Command2.Visible = False
DF1Lbl.Visible = False
DF1Text.Visible = False
RadioButton2.Visible = False
hourglass.Visible = True
DistImg.Bitmap = LoadBitmap(File.DirAssets, "tdist2.jpg")
End Sub
Any help would be appreciated.
I have had success in changing the visibility of buttons, radiobuttons, and panels but have had no success in changing the visibility of labels or edittext. Also, no success at loading a bitmap into the imageview.
I must be missing something basic here, but I have been trying for hours now with no progress. For example,
in Sub Globals I have
Dim df1Lbl AsLabel
in Sub Activity_Create(FirstTime AsBoolean) I have
df1lbl.Initialize("df1lbl")
But when in code, I have
df1Lbl.Visible = False
nothing happens (i.e., the label remains visible).
For the imageview I have
in Sub Globals
Dim DistImg AsImageView
in Sub Activity_Create(FirstTime AsBoolean)
DistImg.Initialize ("DistImg")
in code
DistImg.Bitmap = LoadBitmap(File.DirAssets, "tdist2.jpg")
does not load the bitmap.
I am testing the code in the emulator and receive no error messages. I have attached the zip file for the infant project. Pressing the button Command1 (1st button on left) demonstrates the behaviors mentioned above. Here is the code for Command1:
Sub Command1_Click
'The button (Command2) and RadioButton (RadioButton2) become invisible.
'The label (DF1Lbl) and EditText (DF1Text) do NOT become invisible.
'The imageview (hourglass) does NOT become visible
'the imageview (DistImg) does NOT load the new bitmap
Command2.Visible = False
DF1Lbl.Visible = False
DF1Text.Visible = False
RadioButton2.Visible = False
hourglass.Visible = True
DistImg.Bitmap = LoadBitmap(File.DirAssets, "tdist2.jpg")
End Sub
Any help would be appreciated.