Question

I have a custom file extension that I've coded and can load it using, for example, a file manager.

However two things:

  1. How can I debug my app (in eclipse) from starting it via the intent filter from file manager as there are a few issues and I'd like to go through it in the debugger.

  2. Is there a way to set an icon so when I browse my custom file extension in a file manager I can see my app's launcher icon rather than the plain white rectangle I see?

Thanks.

Was it helpful?

Solution

To debug, put a dialog in onResume() so that your app will pause for input (or some other way of doing this). When it starts, use the debugger to attach to your apps process, e.g. in Studio, Run->Attach debugger to Android process.

For an icon in the chooser, use this:

<intent-filter android:icon="drawable resource"
    ...
</intent-filter>

For browsing, nothing you can do since you do not "own" the extension, you just advertise an intent for it.

OTHER TIPS

  1. Just put your code in onNewIntent(), start the app by debugging as usual, close the app by pressing the home button, open a file in a file manager.

  2. No, most file managers come with their own file icons, and at least there is no way to set an icon for your file type in all file managers. File managers in general are no default feature in Android, so there is no way to somehow set a file icon.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top