i am trying to open the mobile app called “My Files” in a specified folder but can’t seem to get it to work, it may be because i am using the wrong myfiles activity but i haven’t found a document detailing which activity to use to open the app and go to the specified folder.
Currently the app opens to the main menu and so i was wondering if someone knew if it is possible and how to do it.
The code shown below is used to get the myfiles app launched but as already said, can’t seem to get it to go to the directory i want it to
The button used to open the My Files app
Button(
onClick = {
val intent = Intent(Intent.ACTION_MAIN)
intent.setComponent(ComponentName("com.sec.android.app.myfiles", "com.sec.android.app.myfiles.external.ui.MainActivity"))
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
// path to the folder: /storage/emulated/0/Pictures/MAIN_DIRECTORY_NAME
val picturesFolder = File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), MAIN_DIRECTORY_NAME)
intent.putExtra(Intent.EXTRA_ORIGINATING_URI, Uri.fromFile(picturesFolder))
context.startActivity(intent)
}
) {
Text(text = "Open")
}
Where it sends me
My Files app, the location it sends me
If more detail is needed, i would be happy to provide more
And thanks in advance
4