findViewById(R.id.btn02).setOnClickListener(
new
OnClickListener() {
@Override
public
void
onClick(View v) {
Cursor cursor = handler.select();
startManagingCursor(cursor);
while
(cursor.moveToNext()) {
int
_id =cursor.getInt(cursor.getColumnIndex(
"_id"
));
String name =cursor.getString(cursor.getColumnIndex(
"name"
));
String age =cursor.getString(cursor.getColumnIndex(
"age"
));
String phone =cursor.getString(cursor.getColumnIndex(
"phone"
));
String addr =cursor.getString(cursor.getColumnIndex(
"addr"
));
String img=cursor.getString(cursor.getColumnIndex(
"image"
));
tv01.setText(
"seq="
+_id+
"//"
+
"이름="
+name +
"//"
+
"나이="
+age+
"//"
+
"폰="
+phone+
"//"
+
"주소="
+addr+
"//"
+
"이미지="
+img);
Bitmap bitmap=
null
;
try
{
URL url=
new
URL(img);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
int
imageSize=conn.getContentLength();
BufferedInputStream bis=
new
BufferedInputStream(conn.getInputStream(),imageSize);
bitmap=BitmapFactory.decodeStream(bis);
bis.close();
}
catch
(MalformedURLException e) {
e.printStackTrace();
}
catch
(IOException e) {
e.printStackTrace();
}
img01.setAdjustViewBounds(
true
);
img01.setLayoutParams(
new
LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
img01.setScaleType(ImageView.ScaleType.FIT_XY);
img01.setImageBitmap(bitmap);
\ }
}
});
}
}