Skip to main content

Posts

Showing posts with the label focus

How not to lose focus on a login page

I have a simple login form with 2 input fields: "username" and "password". "username" field is focused by default. The problem is that when user clicks outside "username" or "password" fields, the focus is gone (it is neither on "username" nor on "password" fields"). How can I force the focus to be on these 2 fields only ?

android fragments edittext button focus

being new to android app development, I encounter a problem regarding the interaction of android fragments, edittexts, focus and buttons. I have one fragment activity with several tabs. Most tabs have one fragment each. But in one tab, I have a ListFragment and a fragment with edittexts and buttons, which I call edit fragment. When the user selects a list item, the content of the edit fragment is shown in the current tab. When trying to edit a text there, more precisely, when hitting a different key than the backspace key, the new char is not shown, but the first button below gets the focus. Why? And how can I avoid this behavior? Earlier, I had a different activity for the edit fragment and the editing worked perfectly. But for other reasons and because it is recommended, I have only one activity now. Thank you for help! The xml for project_details1: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.andr