Android 如何在所选图片上显示勾号?

Android 如何在所选图片上显示勾号?,android,Android,在我的应用程序中,我使用android gallery选择图片并在imageview中显示。 我的问题是,当我选择任何图片时,在将其设置为imageview之前,我需要在该图片上显示记号标记图像 以下是我的代码: Intent intent = new Intent(Intent.ACTION_PICK); intent.setType("image/*"); startActivityForResult(Intent.createChooser(intent,"Select Pictu

在我的应用程序中,我使用android gallery选择图片并在imageview中显示。 我的问题是,当我选择任何图片时,在将其设置为imageview之前,我需要在该图片上显示记号标记图像

以下是我的代码:

 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;           
        }
    }
}

请帮助我

也许我没有正确理解您的问题,但是如果您的问题只是在图像上方画一个勾号,那么您需要使用FrameLayout而不是简单的ImageView。它应该包含您的图像和上面的无效图像视图。当你需要画勾号时,只需将其图像设置到该图像视图中即可。希望这能对您有所帮助。

我需要在图库图片中打勾,请您帮我输入示例代码。对不起,没有代码可以帮助您。这里有一个你可能会发现有用的链接。您需要为库创建一个适配器,扩展BaseAdapter类。有一个getView()方法需要重写。只需创建一个包含FrameLayout的xml布局,并在getView()中填充数据。如果我没有解释清楚,请告诉我。祝你好运你尝试了什么,结果如何?