reading files in android----Solved
<p>I am wondering does reading files in android only works under onCreate() of an activity?
I having this question because my reading process works when the reading process is in side of onCreate() or in side a method that is called under onCreate.</p>

<p>Following is what I am using for reading a file </p>

<pre><code>try {
            file="";
            InputStream ish =     this.getResources().openRawResource(R.drawable.regular_hero_deck);
            BufferedReader brh = new BufferedReader(new     InputStreamReader(ish));
            if(ish!=null){
                while ((data = brh.readLine()) != null)   {
                    file+=data;
                }
            }
            ish.close();
            regularDeckHero =new Deck&lt;Hero&gt;("heroDeck",file);
        }catch (Exception e){//Catch exception if any
            System.err.println("Error : reading hero deck");}   
</code></pre>

<p>Solution: it is the problem with </p>

<pre><code>InputStream ish =     this.getResources().openRawResource(R.drawable.regular_hero_deck);
</code></pre>

<p>this.getResources() is doesn't give what I wanted, the resources you need is the one from your MainActivty pass this resources to this should work.</p>
