Thanks both of you. I have tried your suggestions, but they don't solve the problem. I had already read that chapter and I commented out the display of the second screen in case that was causing the problem. It is commented out in the code below.
I realise that I am probably making lots of mistakes, but If I can get this stuff working I think that my perspective as a complete beginner may be useful at some point and I will be able to contribute to the wiki.
You might as well have more of the code. This is all of it.
What it is aimed at doing is testing me on a learning process.
I have a file with questions and answers on a single line separated by a comma and there are two screens. I am doing nothing with my file yet but just testing the displays. I have a screen where nothing is diplayed at the moment as the first screen. This will hold the question and it has a button on it to show the second screen which has the answer. At the moment of course I am just trying to get an example of text printed on the screen which I will then replace with something extracted from my strings of questions and answers.
'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 firstScreen, secondScreen As Panel
Dim mainList As List
mainList = File.ReadList(File.DirAssets, "testandroid.txt")
Dim vCounter As Int
Dim holdString As String
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("firstdisplay")
secondScreen.Initialize("")
secondScreen.LoadLayout("knownscreen")
Activity.AddView(secondScreen,0,0,100%x,100%y)
secondScreen.Visible =False
End Sub
Sub Show_Click
'secondScreen.Visible=True
Dim Canvas1 As Canvas
Canvas1.Initialize(Activity) 'this canvas will draw on the activity background
Canvas1.DrawText("This is a nice sentence.", 200dip, 200dip, Typeface.DEFAULT_BOLD, 30, Colors.Blue, "LEFT")
Activity.Invalidate
End Sub