I have used
new File(Environment.getExternalStorageDirectory().toString)
but it gives the path of primary storage.i.e /Storage/emulated/0
I also used
new File(System.getenv("SECONDARY_STORAGE"))
This works well but in some devices of samsung it do not work.
Please help.