찾아보고 열심히 고쳐봤는데요..해결이 안되요ㅠㅠ
에뮬레이터로 실행했을때 화면에 한글이 깨져서 나옵니다.
어떤 부분이 잘 못된걸까요??
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ArrayList <String> arGeneral = new ArrayList();
//ArrayList list1 = new ArrayList();
String path ="/sdcard/";
File file = new File(path+"hdcan_ge_eg33.txt");
StringBuffer strBuffer = new StringBuffer();
try{
//파일 스트림을 준비한다.
FileInputStream fis= new FileInputStream(file);
Reader in = new InputStreamReader(fis, "UTF-8");
byte[] data = new byte[fis.available()];
DataInputStream dataIO = new DataInputStream(fis);
String strLine = null;
String str = dataIO.readLine();
/*
while ((strLine = dataIO.readLine()) !=null)
strBuffer.append(strLine + "\n");
*/
StringTokenizer st = new StringTokenizer(str.substring(str.indexOf("=")+1).trim(), ";");
while (st.hasMoreTokens())
{
arGeneral.add(st.nextToken());
}
dataIO.close();
fis.read(data);
fis.close();//파일 출력 스트림의 닫기
String contents = new String(data);
}
catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ArrayAdapter<String> Adapter;
Adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1,arGeneral);
ListView list1 = (ListView)findViewById(R.id.list);
list1.setAdapter(Adapter);
}
}