Looks like an issue when putting it in the Activity constructor.
Perhaps because the Activity has not been fully set up in terms of
what Context it is using. Try putting this in the onCreate.

On May 7, 5:22 am, "Analdin Judy" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Below is my code for accessing text file
>
> package com.IW.TestText;
>
> import java.io.BufferedReader;
> import java.io.FileInputStream;
> import java.io.IOException;
> import java.io.InputStreamReader;
>
> import android.app.Activity;
> import android.os.Bundle;
> import android.util.Log;
>
> public class TestText extends Activity {
>
>  private String fileName;
>  private String inLine;
>  public TestText()
>  {
>    try {
>           FileInputStream         inFile  = openFileInput("judy.txt");
>           InputStreamReader       isr     = new InputStreamReader(inFile);
>           BufferedReader          in      = new BufferedReader(isr);
>           inLine = in.readLine();
>           inFile.close();
>
>   }catch (IOException e) {
>           showAlert("Warning", "Error Exception " + e.toString(), "ok",
>   true);}
>
>      }
>
>     /** Called when the activity is first created. */
>   @Override
>     public void onCreate(Bundle icicle) {
>
> }
> }
>
> I got the following error "RuntimeException:Not supported in system
> context ".Can anybody please tell me the solution?
>
> --
> Thanks & Regards
>
> Analdin Judy.M
> InfoWave
> Knowledgeware. Beyond Multimedia
> Chennai | INDIA
> M: +91.98416.64705www.i-waves.com
>
> "The information contained in this e-mail (including any attachments) is
> intended by InfoWave for the use of the named individual or entity to which
> it is directed and is CONFIDENTIAL or PRIVILEGED. If you have received this
> e-mail (including any attachments) in error, please do not review, disclose,
> disseminate, distribute or copy this e-mail and attachments. As Electronic
> and Internet communications can be interfered with or affected by viruses
> and other defects, please scan this message and any attachments"
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to