Android Question Don't re-create activity when change the orientation

Lucas Eduardo

Member
Licensed User
Hello, i think i did this sometime ago, but i don't remenber. So, there is a code that don't recreate the activity when the orientation is changed?
I need to do just one activity, not more than this, the solution of create another activty doesn't work to me.

Thanks :D
 

Lucas Eduardo

Member
Licensed User
Got it, and do you know another way to keep my panels, CLVs, all views in the same place when i return from changed orientation?
 

DonManfred

Expert
Licensed User
You can set a activity to run only in a specific orientation. This may limit the recreations a bit...

B4X:
SetActivityAttribute(<ActivityName>,
    android:screenOrientation,
    "landscape"
)
Replace <ActivityName> with your activityname
 

AnandGupta

Well-Known Member
Licensed User
I use below

B4X:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: portrait
    #CanInstallToExternalStorage: False
#End Region
i.e. #SupportedOrientations: portrait

Regards,

Anand
 
Top