如何在android中验证签名板是否空?

时间:2016-09-02 07:31:21

标签: android digital-signature android-security

如何在android中验证签名板是否为空?

如何检查签名是否完全空白,即所有像素都是透明的?

我必须避免每个像素都有一个x-y循环。

2 个答案:

答案 0 :(得分:0)

//globally
private boolean isSignatured = false;

//onCreate
mSignaturePad.setOnSignedListener(new SignaturePad.OnSignedListener() {
@Override
public void onSigned() {
   //Event triggered when the pad is signed
    isSignatured = true;
}

@Override
public void onClear() {
   //Event triggered when the pad is cleared
}
});

//in your on click
if(isSignatured){
    //do next process
}else{
    //intimate to sign
}

答案 1 :(得分:0)

试试这个代码,它正在工作

if(!signature_view.isBitmapEmpty()) {
   saveNotes(signature_view);
  }