如何在SQLite数据库中存储图像
public class Imageupload12 extends Activity { Button buttonLoadImage; ImageView targetImage; int i = 0; Database database = new Database(this); String i1; String img; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main5); buttonLoadImage = (Button) findViewById(R.id.loadimage); targetImage = (ImageView) findViewById(R.id.targetimage); Bundle b = getIntent().getExtras(); if (b != null) { img = b.getString("image"); targetImage2.setImageURI("image"); //i am getting error as i cant assign string to imageview. } buttonLoadImage.setOnClickListener(new Button.OnClickListener() { public void onClick(View arg0) { // TODO Auto-generated method stub Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); Log.i("photo", "" + intent); startActivityForResult(intent, i); i = i + 1; } }); } } } }
幕布斯7119047