How to create folder in android -


I am stuck with the build of a folder in my mobile (Micromax canvas 2). Please remove me where I made a mistake.

  file folder = new file (environment .getExternalStorageDirectory (+ + "/ example"); Boolean success = true; If (! Folder.exists ()) {success = folder.mkdirs (); } If (success) {Toast. GetApplicationContext, "Success", Toast. LNNHH_LOG). Show (); } Other {Toast. Make Text (getApplicationContext (), "Failure", Toast. LNNHHLog) Show (); }   

Permission:

  & lt; Usage-permission Android: name = "android.permission.WRITE_EXTERNAL_STORAGE" />    

  file f1 = new file (GetApplicationContext (.) GetFilesDir () + ""); Fol = new file (F1, "picture"); If (! Fol.exists ()) {fol.mkdir (); }    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -