store image in sqlite
- by bbkaaka
i have the folloing code :
final Gallery g = (Gallery) findViewById(R.id.gallery);
g.setAdapter(new ImageAdapter(this));
g.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView parent, View v, int position, long id) {
final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
Bitmap b = null;
b=BitmapFactory.decodeResource(getResources(),*********);
b.compress(CompressFormat.PNG, 0, outputStream);
AlertDialog.Builder builder = new AlertDialog.Builder(Edit.this);
builder.setTitle("Comfirm");
builder.setMessage("Do you want to choose this picture?");
builder.setPositiveButton("Continue", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
image = outputStream.toByteArray();
}
});
you see * which need type int like android.R.drawble.icon. i want to store the picture when users click to picture how can i get the picture