I wouldn't suggest putting it in a Service unless it is really something you
want to have executing when the user is outside of your app.

For example, a browser typically wouldn't associate a Service with
networking, because all of its networking is there to serve the UI.

On Mon, Jul 18, 2011 at 2:01 PM, Indicator Veritatis <mej1...@yahoo.com>wrote:

> What? Why would a restart of your Activity be a problem while waiting
> for an HTTP response? You DO have the HTTP response in a separate
> thread and Service, don't you?
>
> On Jul 16, 3:41 pm, Brad <bradfull...@gmail.com> wrote:
> > Hi,
> >
> > I'm trying to lock my activity to the current orientation to prevent
> > an orientation change from restarting my activity while I'm waiting
> > for a http response.
> >
> > So I'm trying to use this:
> >
> > setRequestedOrientation(getResources().getConfiguration().orientation);
> >
> > And it works fine for portrait (orientation == 1), but when the device
> > is in landscape it's getting a value of 2 which ==
> >
> > ActivityInfo.SCREEN_ORIENTATION_USER
> >
> > And this doesn't lock the screen.
> >
> > Does anyone have any idea why I'm getting this instead of LANDSCAPE?
> > Any suggestions for a better way to lock the current orientation?
> >
> > Thanks!
>
> --
> 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
>



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

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