I used Environment.getExternalStorageDirectory()
for create directory and save my application file inside of it. till android 8 my application work fine but in higher level it is not working and i cant save any file in primary location and i have to save it in ../Android/data/MY_PACKAGE_NAME. I think it is because of android new policy but now i see there is lot of application which able to make directory and save file in primary storage, I really want to save file in primary storage please help me if three is a solution.
I add android:requestLegacyExternalStorage="true"
into manifest and also this below permission granted:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>