java - how to add deault image in directory??? when create new directory -
how add default image when create directory? code below create directory using alert dailog, want add default image automaticallly if directory created, do?
deault image id (r.drawable.myimage)
. want add image in directory when directory created.
alertdialog.builder alert = new alertdialog.builder(context); alert.settitle("add new photo folder"); // set alert dialog // title here alert.setmessage("enter folder name "); // message here // set edittext view user input final edittext input = new edittext(context); alert.setview(input); alert.setpositivebutton("ok", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int whichbutton) { string srt = input.geteditabletext().tostring(); toast.maketext(context, srt, toast.length_long).show(); file photos = new file(getfilesdir(), srt); if (!photos.exists()) { photos.mkdirs(); gridview.invalidateviews(); gridview.setadapter(simpleadapter); inflatelistview(currentfiles); finish(); startactivity(getintent()); } else { toast.maketext(context, "already exist folder", toast.length_long).show(); } } }); alert.setnegativebutton("cancel", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int whichbutton) { // canceled. dialog.cancel(); } }); // end of alert.setnegativebutton alertdialog alertdialog = alert.create();
Comments
Post a Comment