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"); // tried
this one as well
        intent.setType("application/msword");
        startActivity(intent);

the callee's intent-filter
           <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category
android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="application/msword"/
>
            </intent-filter>


the callee app can pop up, but getIntent return null in onCreate an
onPostCreate.

any idea what's going wrong?


On 8 Apr, 15:56, "nEx.Software" <[email protected]> wrote:
> 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 <[email protected]> wrote:
>
>
>
> > 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.- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to