开发中难免会对图片做一些处理,是否空null、是否有数据等等。
Drawable.ConstantState frontState = iv_front.getDrawable().getCurrent().getConstantState();
Drawable.ConstantState backState = iv_background.getDrawable().getCurrent().getConstantState();
Drawable.ConstantState bodyState = iv_body.getDrawable().getCurrent().getConstantState();
if (frontState==null||backState==null||bodyState==null){
AppContext.showToast("请上传图片");
return;
}
方法有很多的:
1:保存本地一个File,然后View加载File文件,加载完成后直接调用删除文件方法,然后去判断文件是否存在;
2:如果有上传图片需求,那就把图片上传到服务器或者阿里云上,成功or失败;