Widgets run within the launcher. The launcher's activity is not controlled by the application that provides the widget, so setting screenOrientation is not an option (unless we're talking about writing a launcher).
However, one can use regular resource qualifiers - res/layout-port and/or layout-land for widget layouts (and other qualifiers as appropriate), or perhaps create dimension resources and put separate versions under res/values and res/values-land (just one more way of doing it). -- Kostya 2011/6/10 Rajani Golakoti <[email protected]> > Hi Alexy, > Set this android tag in your activity tag in which you are displaying your > view. > *android:screenOrientation="portrait"*. > > > > > On Fri, Jun 10, 2011 at 5:18 AM, Alexey Onuchin <[email protected]>wrote: > >> Hi to all, >> >> I'm developing a simple widget for which I want to leave only portrait >> mode. So is there any way to block lanscape mode like we can do it for >> Activities? >> >> ---- >> Thanks in advance, >> Alexey >> >> -- >> 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 > > > > > -- > Thanks & Regards > Rajani.G. > > > -- > 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 > -- 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

