well, i did a very stupid mistake. i put wrong file name;lol thanks for your time
On Feb 19, 1:20 pm, Naina K <kna...@gmail.com> wrote: > Hi zeeshan , > > As you said you have changed only the text file. I assume that you > have added your new file in assets folder. I am not sure if you have > added Ur_file_name.xml in res/layout folder. > I mean you should also add a .xml file in layout folder with the same > name as your file. You can also check it is already done as > read_asset.xml in layout folder. Just check, i am guessing that this > is the problem. > > Thanks, > > Naina > > On 2/19/09, david liu <wanqing.da...@gmail.com> wrote: > > > > > Can you paste the log here? > > > On Thu, Feb 19, 2009 at 6:31 PM, zeeshan <genx...@gmail.com> wrote: > > >> i am trying to access a resource file by > > >> try { > >> InputStream is = getAssets().open("read_asset.txt"); > > >> int size = is.available(); > > >> byte[] buffer = new byte[size]; > >> is.read(buffer); > >> is.close(); > > >> // Convert the buffer into a string. > >> String text = new String(buffer); > > >> // Finally stick the string into the text view. > >> TextView tv = (TextView)findViewById(R.id.text); > >> tv.setText(text); > >> } catch (IOException e) { > > >> // Should never happen! > >> throw new RuntimeException(e); > >> } > > >> and it is returning me exception, please help me > > >> thanks- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---