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([SIZE=2][COLOR=#800000]"df1lbl")
But when in code, I have
[SIZE=2][FONT=Courier New][SIZE=2][COLOR=black]df1Lbl.Visible = [COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]False[/COLOR]
nothing happens (i.e., the label remains visible).
For the imageview I have
in Sub Globals
[COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/COLOR][/COLOR] DistImg [FONT=Courier New][SIZE=2][COLOR=#0000ff]As[/COLOR][COLOR=#008b8b]ImageView[/COLOR]
in [FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Sub [/COLOR]Activity_Create(FirstTime [COLOR=#0000ff]As[/COLOR][COLOR=#008b8b]Boolean[/COLOR])[/COLOR]
DistImg.Initialize ([COLOR=#800000]"DistImg"[/COLOR])
in code
[COLOR=black]DistImg.Bitmap =[/COLOR] [SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]LoadBitmap[/COLOR][/COLOR]([SIZE=2][COLOR=#0000ff]File[/COLOR].DirAssets, [COLOR=#800000]"tdist2.jpg"[/COLOR])
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:
[SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]Sub [/COLOR][/COLOR]Command1_Click
[SIZE=2][COLOR=#008000]'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
[/COLOR]Command2.Visible = [COLOR=#0000ff]False
[/COLOR]DF1Lbl.Visible = [COLOR=#0000ff]False
[/COLOR]DF1Text.Visible = [COLOR=#0000ff]False
[/COLOR]RadioButton2.Visible = [COLOR=#0000ff]False[/COLOR]
hourglass.Visible = [COLOR=#0000ff]True[/COLOR]
DistImg.Bitmap = [COLOR=#0000ff]LoadBitmap[/COLOR]([COLOR=#0000ff]File[/COLOR].DirAssets, [COLOR=#800000]"tdist2.jpg"[/COLOR])
[COLOR=#0000ff]End Sub
[COLOR=black]Any help would be appreciated.[/COLOR][/COLOR][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]