Wednesday, May 12, 2010

[android-developers] Re: How to detect orientation change in home screen widget?

Hi ,

Did you get idea about the orientation change in widgets ?

Kamal

On Mar 16, 2:32 am, kknight <pan...@gmail.com> wrote:
> I am writing a home screenwidgetand want to update (modify) the home
> screenwidgetwhen the deviceorientationchanges from portrait to
> landscape or the other way. How can I make it?
>
> Currently, I tried to register to CONFIGURATION_CHANGED action like
> the code below, but the Android didn't allow me to do that by saying
> "IntentReceiver components are not allowed to register to receive
> intents".
> The reason that I register to CONFIGURATION_CHANGED is that, the
> Android spec said about ACTION_CONFIGURATION_CHANGED: "You can not
> receive this through components declared in manifests, only by
> explicitly registering for it with Context.registerReceiver(). "
>
> Can someone help me? Thanks.
>
> public class MyWidget extends AppWidgetProvider {
>
>     @Override
>     public void onEnabled(Context context) {
>         super.onEnabled(context);
>         this.registerReceiver(this, new
> IntentFilter(Intent.ACTION_CONFIGURATION_CHANGED));
>     }

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate