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 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); > > 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" <justin.shapc...@gmail.com> 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 <xianguan...@gmail.com> 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 - > > -- > Dianne Hackborn > Android framework engineer > hack...@android.com > > Note: please don't send private questions to me, as I don't have time to > provide private support, and so won't reply to such e-mails. All such > questions should be posted on public forums, where I and others can see and > answer them.- 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 android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---