@Jim
Yes it does get called. I added the NEW_TASK and the SINGLE_TOP
flags to be able to start the intent and then to start subsequent
ones. But as you note here if I don't remove the NEW_TASK flag
each tiem I revisit the launching code I will keep generating a new
intent - right?
Regarding your previous post, yes the Extras bundle include strings
and keys and in fact that's the code I use in the OnCreate to pass
other params to the intent and it works so I am sure that's not the
case. if you right above then this explains what's going on.

@Kostya
A very legitimate pt ;) I should have included this in the original
posting. The exception occurs once I reference the intent handler.
If Jim is right from above I am assuming I will need to call use
the NEW_TASK flag only once to launch the original intent?

I/System.out(  341): ######### 1 = onNewIntent has been called ...
E/AndroidRuntime(  341): java.lang.NullPointerException
E/AndroidRuntime(  341):        at
org.mortbay.ijetty.snapPic2.mysnapPic2ServiceImpl.onNewIntent(mysnapPic2ServiceImpl.java:
164)
E/AndroidRuntime(  341):        at
android.app.Instrumentation.callActivityOnNewIntent(Instrumentation.java:
1195)
E/AndroidRuntime(  341):        at
android.app.ActivityThread.deliverNewIntents(ActivityThread.java:2471)
E/AndroidRuntime(  341):        at
android.app.ActivityThread.performNewIntents(ActivityThread.java:2483)
E/AndroidRuntime(  341):        at
android.app.ActivityThread.handleNewIntent(ActivityThread.java:2491)
E/AndroidRuntime(  341):        at android.app.ActivityThread.access
$2900(ActivityThread.java:116)
E/AndroidRuntime(  341):        at android.app.ActivityThread
$H.handleMessage(ActivityThread.java:1840)
E/AndroidRuntime(  341):        at
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(  341):        at android.os.Looper.loop(Looper.java:
123)
E/AndroidRuntime(  341):        at
android.app.ActivityThread.main(ActivityThread.java:4203)
E/AndroidRuntime(  341):        at
java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(  341):        at
java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(  341):        at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:791)
E/AndroidRuntime(  341):        at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
E/AndroidRuntime(  341):        at
dalvik.system.NativeStart.main(Native Method)

On Aug 9, 3:46 pm, Jim <secondphonea...@gmail.com> wrote:
> Didn't see your previous post... FLAG_ACTIVITY_SINGLE_TOP causes a
> call to onNewIntent, but FLAG_ACTIVITY_NEW_TASK starts a new task and
> new activity. Is onNewIntent even being called? It shouldn't be since
> FLAG_ACTIVITY_NEW_TASK means the activity can't be recycled, it must
> be created in the current "new" task. You probably want
> FLAG_ACTIVITY_CLEAR_TOP and FLAG_ACTIVITY_SINGLE_TOP...
>
> -Jim
>
> On Aug 9, 1:59 pm, Jim <secondphonea...@gmail.com> wrote:
>
>
>
>
>
>
>
> > That's true. Do you do anything in onResume() to alter the data? And,
> > this might sound silly, but are you sure a String was stored where
> > getString is called? (For example, if you putExtra a bundle, then
> > getExtra returns a Bundle, not a string...)
>
> > Hope that helps.
>
> > -Jim
>
> > On Aug 9, 1:16 pm, kypriakos <demet...@ece.neu.edu> wrote:
>
> > > Gotcha - but do you agree that the following should work and return
> > > the Extras bundle?
>
> > >     @Override
> > >         protected void onNewIntent(Intent intent){
>
> > >                 Bundle extras = intent.getExtras();
> > >                 ...
>
> > > Like Mark said, the intent var that is passed to the onNewIntent each
> > > time I start a new
> > > intent on a particular activity should hold a ref to that new intent
> > > and I should be able
> > > to access the data from it. No?
>
> > > On Aug 9, 1:26 pm, Jim <secondphonea...@gmail.com> wrote:
>
> > > > Since setIntent() stores a reference to the intent sent to
> > > > onNewIntent(), you need to either capture the data there or copy the
> > > > Intent to a local variable and reference it. Once onNewIntent()
> > > > finishes, the Intent goes away and your reference is null.
>
> > > > Try that...
>
> > > > -Jim
>
> > > > On Aug 9, 10:46 am, kypriakos <demet...@ece.neu.edu> wrote:
>
> > > > > > Blech.
>
> > > > > he he ;)
>
> > > > > > Use the Intent supplied to onNewIntent(). The Intent returned by
> > > > > > getIntent() will always be the original Intent used to create the
> > > > > > activity.
>
> > > > > But I am - and that's where the null exception occurs. Not sure if the
> > > > > setIntent or  the super are needed. I will poke around a bit more to
> > > > > see what is going on. But if the Intent supplied by the onNewIntent()
> > > > > is what I need then that puts me on the right path.
>
> > > > > Thanks again guys

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

Reply via email to