openFileInput() is a method on Context (e.g., Activity), not AsyncTask. On Sun, Feb 5, 2012 at 8:32 AM, Dave D <[email protected]> wrote: > I have a class that reads from an input file fine > but when I add it to an Async thread it errors on openFileInput with > the method being undefined even though I > have imported exactly the same classes > Am I not allowed to use this method in the background? > > code snippet is: > public class buildcustomer extends AsyncTask<TextView ,Integer ,String >> { > @Override > protected String doInBackground(TextView... tv) { > try { > FileInputStream inFile = > openFileInput("customer.csv"); > InputStreamReader isr = new > InputStreamReader(inFile); > BufferedReader in = new > BufferedReader(isr); > > while(!end){ > String l_line = in.readLine(); > .... > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en
-- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

