我最近发现我出于某种原因无法在Android小部件上使用FileInputStream。不幸的是,我无法找到解决方案。 我每次尝试都会得到
无法解析方法' openFileInput(java.lang.string)
你能帮帮我吗?
try {
FileInputStream HomeWorkIN = openFileInput(Class + ".txt");
InputStreamReader HomeWorkREAD = new InputStreamReader(HomeWorkIN);
char[] data = new char[ReadingBlock];
String FinalData = "";
int Size;
try {
while ((Size = HomeWorkREAD.read(data)) > 0) {
String ReadData = String.copyValueOf(data, 0, Size);
FinalData += ReadData;
data = new char[ReadingBlock];
}
HomeWork += FinalData;
} catch (IOException e) {
e.printStackTrace();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}