#Region  Project Attributes
[/QUOTE]
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    #SupportedOrientations: Landscape
    #CanInstallToExternalStorage: False
#End Region
#Region  Activity Attributes
'Phone spec is 800 x 1340 pixels
    #FullScreen: True
    #IncludeTitle: False
    #SupportedOrientations: Landscape
#End Region
	 
	
	
		
	
 
	
	
	
	
	
	
	
	
	
		Dim lv As LayoutValues = GetDeviceLayoutValues
        Ys = lv.Height : Xs = lv.Width
        'Width1 & height1 800  1276 - due to autorotate
        Log("Xs1 = '"&Xs&"  "&"Ys1 = "&Ys)
        Log("Screen1 100%x = "&100%x&" 100%y = "&100%y)
        If (Ys > Xs ) Then
            Log("Portrait1 detected")
            'ptrait_det = True
            Xs = 1340 : Ys = 736
        End If
	 
	
	
		
	
 
    
	
	
	
	
	
	
	
	
	
		B4XPages.MainPage.RootMP.RemoveAllViews
    Log("device layout_login "&GetDeviceLayoutValues)
    Dim lv As LayoutValues = GetDeviceLayoutValues
    Ys = lv.Height : Xs = lv.Width
    scalex = Xs/Ys
    Log("New X Y in HChange "&Xs& "   "&Ys)
    Log("Redraw screen")
    
    B4XPages.MainPage.RootMp.LoadLayout("Login_Pg")
  'Below module will utilise the detected size to redraw the screen
    Login_Page_Ctr
	 
	
	
		
	
 
I noticed that my layout will stick to the portrait width if I rotate the tablet from Landscape to Portrait during app deployment. 
In B4xpages, I tried to remove the view and draw with the newly detected landscape x,y sizes, but it seems that the tablet is controlling the screen display.
Is there anything I can do with it using my code?
Note: This issue will not exist if I kept the tablet stayed at a fixed orientation(either portrait or landscape)  during deployment
Thanks
Rgds,
Liew