07-18-2012 02:27 PM
Does anyone know how to load the contents of a text file packaged locally with the app into a new screen?
My Flow:
1) List Items with titles
2) User clicks list item
3) Detect which item clicked
4) Based on click, load title, and content into a new screen
5) Go back to original screen (back key)
Also, is there sample code available for this? Seems simple enough.
07-18-2012 04:08 PM
You'll use Class.getResourceAsStream() to read the file from your jar.
See also Class.forName()
You get "Class" for your app name, then call getResourceAsStream().
Once you have the stream, you can read in the file contents as if it were a regular stream file.