Choose folder intent and work when the intent is complete?

So, I am making a wallpaper, and I want the user to select a folder. So I have a button in the settings that launches the intention to open the image, but what I want is actually just a directory (I think, in the worst case scenario, I can delete the file name from the end). So my first problem: what's the best way to select only a folder?

The second problem is how do I get notified when an intention to complete?

public class FilePreference extends DialogPreference implements View.OnClickListener { public void onClick(View v) { // open up a gallery/file browser Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); getContext().startActivity(Intent.createChooser(intent, "Select Folder")); } 
+4
source share
3 answers

Well, that helped a bit, I managed to figure out that my wallpaper service was actually active. SO, then I had to find my preference by name and add a pointer to it so that preference could use startActivityForResult and onActivityResult

0
source

use Activity.startActivityForResult and override Activity.onActivityResult

+2
source

I’m trying to find a gym for training until I can sell my electric bike and move to Wilmington, North Carolina, where I’m going to do three sofas. 1. Vicious trajectory 2. Failure of Del Blanco and 3 Mississippi Non Calante (location unknown)

0
source

All Articles