Actually, it can read fine to toCharArray, since that just returns a
char array. However, since you were basing it off an empty string,
the array length was 0, and so it wasn't reading any bytes :)
David wrote:
> I found the problem. An InputStreamReader will not read() to a
> String.toCharArray
I found the problem. An InputStreamReader will not read() to a
String.toCharArray(). You have to use a char[]. Here is my new
function for reference:
public String loadFile(String filename)
{
try
{
FileInputStream fis = openF
Unfortunately, that didn't solve my problem. Any other help?
P.S. I tried that tutorial in normal java and it worked, but not in
android.
On Feb 11, 5:51 pm, Mark Murphy wrote:
> David wrote:
> > Hey guys, I need some help with reading the contents of a file. I have
> > a plaintext file called
David wrote:
> Hey guys, I need some help with reading the contents of a file. I have
> a plaintext file called 'test' in my app's files/ directory. I have
> this code to read it:
>
> public String loadFile(String filename)
> {
> try
> {
>
David wrote:
> Hey guys, I need some help with reading the contents of a file. I have
> a plaintext file called 'test' in my app's files/ directory. I have
> this code to read it:
>
> public String loadFile(String filename)
> {
> try
> {
>
5 matches
Mail list logo