[android-developers] Re: how to let an application as the default app of certain file type

2009-04-09 Thread Derek
Dianne, you are right. What I should say is that getIntent().getData() returns null, even though the caller app uses intent.setData(). Any idea why the data is not passed to the callee app? On 8 Apr, 18:56, Dianne Hackborn hack...@android.com wrote: Um, getIntent() will never return null in

[android-developers] Re: how to let an application as the default app of certain file type

2009-04-08 Thread nEx.Software
This is how I get the filename: File f1 = new File(getIntent().getData().getPath()); I don't know how to enumerate applications which can handle a certain type of file though. On Apr 7, 10:49 pm, Derek xianguan...@gmail.com wrote: the other question is that if I'm develop an file explorer,

[android-developers] Re: how to let an application as the default app of certain file type

2009-04-08 Thread nEx.Software
To get a list of activities which can handle a data type: Intent.queryIntentActivities() or Intent.queryIntentActivityOptions() appear to be the ticket. or, just use: Intent.createChooser() On Apr 8, 7:56 am, nEx.Software justin.shapc...@gmail.com wrote: This is how I get the filename: File

[android-developers] Re: how to let an application as the default app of certain file type

2009-04-08 Thread Derek
I called getIntent in both onCreate and onPostCreate, but both return null. below is my test code the caller Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.fromFile(new File(/sdcard/abc.doc))); //int.putExtra(Intent.EXTRA_TEXT, /sdcard/abc.doc); //

[android-developers] Re: how to let an application as the default app of certain file type

2009-04-08 Thread Dianne Hackborn
Use queryIntentActivities(). On Wed, Apr 8, 2009 at 8:25 AM, nEx.Software justin.shapc...@gmail.comwrote: To get a list of activities which can handle a data type: Intent.queryIntentActivities() or Intent.queryIntentActivityOptions() appear to be the ticket. or, just use:

[android-developers] Re: how to let an application as the default app of certain file type

2009-04-08 Thread Dianne Hackborn
Um, getIntent() will never return null in onCreate(). On Wed, Apr 8, 2009 at 10:44 AM, Derek xianguan...@gmail.com wrote: I called getIntent in both onCreate and onPostCreate, but both return null. below is my test code the caller Intent intent = new Intent(Intent.ACTION_VIEW);

[android-developers] Re: how to let an application as the default app of certain file type

2009-04-07 Thread Derek
the other question is that if I'm develop an file explorer, how can I know all the existing associations between file type (extensions) and intents. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers