I'm trying to make it so when a user launches the app for the first time, a new folder is created within the Gallery section of the phone and ISN'T duplicated every time the app is launched. I've looked through some answers on here but most are either confusing or out-of-date. Please can somebody help?
I tried the following but it doesn't seem to work:
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_profile); final File root = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + File.separator + "MyNewFolderName" + File.separator) }; I have also included this line in AndroidManifext.xml:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
adb shellto get at the command line shell in the device or emulator and poke around external storage that way. Both of those work off the filesystem, not theMediaStore, and so your new directory should be visible immediately.