Using flag FLAG_ACTIVITY_NEW_TASK is done as follows:

Intent startIntent = new Intent();
// Initialize Intent to start your Activity implicitly or explicitly
startIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

Regards,

Droid-san

On Jul 22, 7:53 am, Ajmer singh <[email protected]> wrote:
> Hi All
>
> When i try start activity from inside a service onCreate() method,Its gives
> me the Exception
>
> *"ERROR/AndroidRuntime(705): java.lang.RuntimeException: Unable to create
> service morvee.com.util.StoreAds: android.util.AndroidRuntimeException:
> Calling startActivity() from outside of an Activity  context requires the
> FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?"*
>
> I am a new to the android development,Could you please let me know how i can
> use *FLAG_ACTIVITY_NEW_TASK.*
>
> Please help!
>
> On Tue, Jul 20, 2010 at 10:51 PM, TreKing <[email protected]> wrote:
> > On Mon, Jul 19, 2010 at 5:02 AM, Ajmer singh 
> > <[email protected]>wrote:
>
> >> Basically i want to start a new activity from a background service,Is that
> >> possible ?
>
> > Of course it is. startActivity(). Done.
>
> > -------------------------------------------------------------------------------------------------
> > TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> > transit tracking app for Android-powered devices
>
> >  --
> > 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]<android-developers%[email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> *Thanks and Regards
> Ajmer Singh*

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