【发布时间】:2014-05-17 23:16:59
【问题描述】:
我正在使用fos.write(some_number)
但是当我尝试显示该数字时,它不会大于 255。
这是第二个活动的代码:
FileOutputStream fos;
try {
fos = openFileOutput("Income", Context.MODE_PRIVATE);
//"Income" is the number that is written on the TextField
fos.write(Income);
fos.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
第一个活动的代码:
try {
FileInputStream fis;
fis = openFileInput("Income");
TOTAL_INCOME = fis.read();
fis.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//...
//....
TextView textView = (TextView) findViewById(R.id.IncomeValue);
textView.setText(""+ TOTAL_INCOME);
【问题讨论】: