I have the following code:

void OpenFile()
        {
            byte[] content = new byte[1024];
            try
            {
                Stream fis = OpenFileInput(QUICKEDIT_FILENAME);
                if (fis.Read(content,0,content.Length) > 0)
                                {
                                        EditText editText = 
(EditText)FindViewById(Resource.Id.fileEditor);
                        UTF8Encoding enc = new UTF8Encoding();
                                        //if (enc.GetChars(content).Length>0)
                        //
editText.SetText(enc.GetChars(content),0,(enc.GetChars(content)).Length-1);
                                }
                fis.Close();
            }
            catch (Java.IO.FileNotFoundException e)
            {
                Log.Error(QUICKEDIT_TAG, e.Message);
            }
            catch (Java.IO.IOException e)
            {
                Log.Error(QUICKEDIT_TAG, e.Message);
            }
        }

and if I uncomment the lines that contain enc.GetChars the code hangs both
in the emulator and on a phone.  No exception is thrown, the app stops
responding and has to be killed.  Any thoughts would be appreciated.

TIA -
John

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Reading-from-a-file-tp5095746p5095746.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to