-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReadSignature.enc
38 lines (31 loc) · 1.23 KB
/
ReadSignature.enc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.hfad.registration;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.Toast;
import java.io.File;
public class ReadSignature extends AppCompatActivity {
ImageView imageView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.read_signature_layout);
Intent intent = getIntent();
imageView = findViewById(R.id.mySignImage);
}
public void showSignImage(View view){
ContextWrapper cw = new ContextWrapper(getApplicationContext());
File directory = cw.getDir("imageDir", Context.MODE_PRIVATE);
File file = new File(directory,"one"+".jpg");
if(file.toString().length()<0){
Toast.makeText(ReadSignature.this,"There is no signature "+directory.toString(), Toast.LENGTH_SHORT).show();
}
else
imageView.setImageDrawable(Drawable.createFromPath(file.toString()));
}
}