How to show tick mark on selected picture?
In my app, I am using android gallery to select the picture and show in imageview. My problem is when I select any picture, I need to show tick mark image on that picture before setting it on imageview.
开发者_如何学运维Following is my code :
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
startActivityForResult(Intent.createChooser(intent,"Select Picture"), SELECT_PICTURE);
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
if (resultCode == Activity.RESULT_OK)
{
switch(requestCode)
{
case SELECT_PICTURE:
Uri selectedImageUri = data.getData();
try {
filemanagerstring = selectedImageUri.getPath();
selectedImagePath = getPath(selectedImageUri);
Intent in = new Intent(this,DefaultSubmission.class);
if(selectedImagePath!=null && filemanagerstring!= null)
{
DefaultSubmission.flag = true;
in.putExtra("IMAGE_PATH", selectedImagePath);
in.putExtra("filemanagerstring", filemanagerstring);
startActivity(in);
}
finish();
} catch (Exception e){
Toast.makeText(getApplicationContext(), "Internal error",Toast.LENGTH_LONG).show();
Log.e(e.getClass().getName(), e.getMessage(), e);}
break;
}
}
}
Please help me
Maybe I didn't understand your question properly, but if your problem is just in drawing a tick above your image, then you need to use FrameLayout instead of a simple ImageView. It should contain your image and a void ImageView above it. When you need to draw a tick - just set its image into that ImageView. Hope this will help you.
精彩评论