-
Notifications
You must be signed in to change notification settings - Fork 95
Expand file tree
/
Copy pathCheckFile.java
More file actions
44 lines (29 loc) · 1.11 KB
/
Copy pathCheckFile.java
File metadata and controls
44 lines (29 loc) · 1.11 KB
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
39
40
41
42
package com.jni.anto.kalip;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import java.io.File;
public class CheckFile extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
Button b = (Button) findViewById(R.id.button);
b.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
File file = new File("/sdcard/test");
if (file.exists()) {
Toast.makeText(getApplicationContext(),"File Exist",Toast.LENGTH_LONG).show();
} else {
Toast.makeText(getApplicationContext(),"File Doesnt Exist",Toast.LENGTH_LONG).show();
}
}
});
}
}