print integer and array from file android

Posted by vik on Stack Overflow See other posts from Stack Overflow or by vik
Published on 2013-10-29T21:50:50Z Indexed on 2013/10/29 21:54 UTC
Read the original article Hit count: 264

i want to open a file and then calculate the integer and array value from file and print on the screen. i tried this but not working

           @Override
        protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
          TextView av = new TextView(this);
         setContentView(av);
try {
        String i = "abc.xyz";

        InputStream in = assets.open(i);
        try {
            DataInputStream din = new DataInputStream(in);
            int value = din.readInt(); // print value on screen
            int[] arry = new int[1]; // print arry on screen how to do it
            int arry[1] = din.readInt();
            }

        }
        finally {
            in.close();
        }
    }
    catch (IOException e) {
        throw new PuzzleIOException(e);
    }

   av.setText(size);
                      }

© Stack Overflow or respective owner

Related posts about android

Related posts about arrays