print integer and array from file android
- by vik
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);
}