这是我在数据库中插入图像的代码。单击browsebutton2时如何从数据库中检索相同的图像?
BrowseButton=(Button)findViewById(R.id.BrowseButton);
BrowseButton2=(Button)findViewById(R.id.BrowseButton2);
adapter = new ContactImageAdapter(this, R.layout.screen_list, imageArry);
BrowseButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Bitmap image = BitmapFactory.decodeResource(getResources(),R.drawable.facebook);
image.compress(Bitmap.CompressFormat.JPEG, 100, stream);
byte[] imageInByte = stream.toByteArray();
Log.d("Insert: ", "Inserting ..");
db.addContact(new Contact("FaceBook", imageInByte));
}
});
BrowseButton2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});