을 작동하지 않습니다 :읽기 특정 부분이 내 코드입니다
File root = Environment.getExternalStorageDirectory();
File dir = new File (root.getAbsolutePath() + "/Bonbon info");
dir.mkdirs();
File f = new File(dir, "paket.txt");
StringBuilder text = new StringBuilder();
try {
BufferedReader br = new BufferedReader(new FileReader(f));
String line;
br.skip(60);
int charactersRead = 0;
while ((line = br.readLine()) != null && charactersRead < 12) {
text.append(line);
text.append('\n');
charactersRead++;
}
}
catch (IOException e) {
}
final String URL = text.toString();
TextView tv = (TextView)findViewById(R.id.textView2);
tv.setText(text);
읽기가 작동,하지만 난 단지 12 문자를 읽을 수 없습니다, 그것은 모르는, 파일의 끝 물마루 읽고 왜.
나는 이해할 수 없다. 읽는 모든 행에 대해 문자 수를 1 씩 증가시키고 있습니까? – EboMike
모르겠다. 나는 여기서 예를 든다. ?? – Goran