I have an intent that starts the default Android mail client:

Intent emailIntent = this.getPackageManager().getLaunchIntentForPackage( 
"com.android.email" );
this.startActivity( emailIntent );

Very simple stuff, and it fires off the Email client, from an "Import from 
Email" button in my app.

My application is also registered with an <intent-filter> to open PDF files.
So, if I use the above Intent to open up the Email client, find an email with a 
PDF attachment, download it, launch it, select my application from the 
chooser... then everything loads great.

Now if I hit my "Import from Email" button again, the intent runs, but the 
Email client is never brought into the foreground.

Am I missing something when using startActivity() to (re)launch the correct app?
I have tried checking if the intent is OK by following this 
http://developer.android.com/training/basics/intents/sending.html#Verify but it 
always returns true (and that makes sense, as it can find the Application, but 
it's just not bringing it to the foreground).

I have also tried using startActivityForResult(), but as explained in the 
Android docs, this fires off a "cancel" immediately, because the Activity is 
not Explicit, but Implicit (thought I'd try it, just in case).

I feel like I'm missing something, a step, a call to something... or have I hit 
upon some strange loop that works in one case, but cannot keep looping?  Any 
help/pointers would be greatly appreciated!

-- 
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