Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- File photos = new File(getFilesDir(),"photos");
- photos.mkdir();
- AlertDialog.Builder alert = new AlertDialog.Builder(this);
- alert.setTitle("Title");
- alert.setMessage("Message");
- // Set an EditText view to get user input
- final EditText input = new EditText(this);
- alert.setView(input);
- alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int whichButton) {
- String value = input.getText();
- // Do something with value!
- //This is where you would put your make directory code
- File photos = new File(getFilesDir(),value);
- photos.mkdir();
- }
- });
- alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int whichButton) {
- // Canceled.
- }
- });
- alert.show();
- String value = "directory to create"
- File photos = new File(getFilesDir(),value);
- if(!photos.exists())
- {
- if(photos.mkdir())
- {
- //directory is created;
- }
- }
- AlertDialog.Builder alert = new AlertDialog.Builder(this);
- alert.setTitle("Title");
- alert.setMessage("Message");
- // Set an EditText view to get user input
- final EditText input = new EditText(this);
- alert.setView(input);
- alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int whichButton) {
- String value = input.getText();
- // Do something with value!
- //This is where you would put your make directory code
- File photos = new File(getFilesDir(),value);
- photos.mkdir();
- }
- });
- alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int whichButton) {
- // Canceled.
- }
- });
- alert.show();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement