I put header
on my ListView
because I wanted it to roll along with it. In this header there are two EditText
, when I click on the second, the focus comes back first in less than one second. You do not even have time to write anything in the second field, and every time I click on it, does anyone have any idea what it is? (I took the general activity code to get smaller)
class ConfigActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.config)
var header = layoutInflater.inflate(R.layout.config_header, null)
lvOptions.addHeaderView(header)
var adapter = OptionsAdapter(this, ArrayList<Option>()) //só pra criar o adapter da listview, vazia mesmo, só com o header
lvOptions.adapter = adapter
}
}
here config_header.xml (In the config.xml there is only the ListView and in the Adapter there is nothing related to the Header)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<EditText
android:id="@+id/eTNome"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Nome"
android:inputType="textPersonName"
android:maxLines="1" />
<EditText
android:id="@+id/eTRendaM"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Renda mensal"
android:inputType="number"
android:maxLines="1" />
</LinearLayout>