检查图像视图是否为空?

时间:2018-06-28 04:32:19

标签: android-studio

我想停止上传照片,如果图像视图为空,则其他数据。我已经将图像设置为图像视图中的源。但如果我不使用相机拍摄图像,则不应上传。该怎么做?

1 个答案:

答案 0 :(得分:2)

希望此代码有帮助:

if (yourImageView.getDrawable()==null){ //your code for stopping uploading here! }

祝你好运!

相关问题