ck is a TextWriter object and you're passing it to the StartActivity method - that's not valid and that's why you get the exception that a TextWriter can't be cast to an Intent.
(StartActivity is expecting an Intent or Activity to be passed to it).
Dim ck As TextWriter
StartActivity(ck)
Martin.
Martin, Thanks for the reply, I must be lost on this one. I am new at this
I changed ck to Intent and still getting the error BufferedWriter
Is it possible to write text to a file when the Checkbox is true? Am I writing this code completely wrong.
Sub CheckBoxShowImage_CheckedChange(Checked As Boolean)
Dim cb As TextReader
cb.Initialize(File.OpenInput(DirName, FileName))
Dim ck As Intent
ck.Initialize(File.OpenOutput(DirName, FileName, False))
ck.WriteLine("test") ' writes test to file
myImageView.Initialize('myImageView')
If Checked = True Then
StartActivity(ck)
myImageView.Visible = True
Else
myImageView.Visible = False
End If
End Sub