store image in sqlite

Posted by bbkaaka on Stack Overflow See other posts from Stack Overflow or by bbkaaka
Published on 2010-11-29T09:00:19Z Indexed on 2011/01/16 11:53 UTC
Read the original article Hit count: 184

Filed under:
|

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

© Stack Overflow or respective owner

Related posts about android

Related posts about android-gallery