Activity doesn't always slide upwards when EditText is clicked

rgately

Member
Licensed User
Longtime User
Greetings,

I want the Activity to slide upwards whenever I click on an EditText that is positioned below the keyboard. That’s how my Samsung Tab 7 WIFI normally behaves but for some reason the Activity loses this behavior under certain circumstances. And when this happens, it is not possible to see the EditText because the Activity won’t automatically slide up.

I created a simple app to try to figure out the cause. The app consists of 2 EditText boxes and 2 Buttons. One of the EditText boxes are positioned at the top of the screen and the other EditText is positioned at the bottom of the screen. It doesn’t matter where the 2 buttons are placed.

The simple app works as it should with the Activity sliding upwards whenever the lower EditText is clicked, and it doesn’t matter if the two buttons are clicked.

The problem arises when I add a ScrollView or ListView. When I add a ScrollView at design time with its Visible property set True then this is what happens at run time. The Activity slides fine until one of the buttons are clicked. All that the buttons are doing is toggling each others Visible property. They seemingly have nothing to do with the ScrollView or the EditText but yet changing their Visible properties is enough to prevent the Activity from sliding upwards again. I don’t see the connection.

I’ve looked at numerous forum threads regarding ScrollView, EditText, Focus Etc. but did not find anything that looked like a solution. Again, all I’d like to do is: allow the Activity to slide upwards whenever an EditText (that is positioned below the keyboard) is clicked on.

Hopefully someone has a solution or can point me in the right direction.


’Simple Test
Sub Globals
Dim Button1 As Button
Dim Button2 As Button
Dim EditText1 As EditText
Dim EditText2 As EditText
End Sub

Sub Activity_Create(FirstTime As Boolean)
activity.LoadLayout("Test")
End Sub

Sub Button2_Click
If Button1.visible =True Then
Button1.visible =False
Else
Button1.visible =True
End If
End Sub

Sub Button1_Click
If Button2.visible =True Then
Button2.visible =False
Else
Button2.visible =True
End If
End Sub
 
Last edited:

rgately

Member
Licensed User
Longtime User
Here's the project. It is named "Test.b4a" Thanks.
 

Attachments

  • Activity Slide Test.zip
    15.6 KB · Views: 192
Upvote 0

rgately

Member
Licensed User
Longtime User
Thanks for pointing me in the right direction. I will search the forum for how to modify the Manifest File before I ask more questions.
 
Upvote 0

rgately

Member
Licensed User
Longtime User
Problem solved. Tweaking the manifest file did the trick. Makes me want to know more about what can be done with the manifest file.

Thanks again!
 
Upvote 0
Top