I have this annoying problem. My app has 2 activities (tabs) Activity1:listview, Activity2:editText+listview. App starts with Tab1(Activity1). When i open 2nd Activity (with edittext), no matter if EditText is selected or not (programmable), when i click on EditText, nothing happens (softKeyboard should appear). Only solution is to change activity (click on Tab1 widget) and return to activity 2 - after this tab swap, keyboard works fine.
Part of XML layout with edittext:
<EditText
android:hint="Wyszukaj..."
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="45dp"
android:inputType="textAutoComplete|text"
android:singleLine="true"
android:focusable="true"
android:focusableInTouchMode="true"
>
and here is 2 overrided method from Activity2
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tab2);
this.db = DataBase.getInstance();
this.ds = DataSource.getInstance();
this.prepareListView();
}
@Override
protected void onResume() {
super.onResume();
this.doubleBackToExitPressedOnce = false;
}
private void prepareListView() {
sbal = this.db.getAllStops();
adapter = new StopListAdapter(this, sbal);
lv = (ListView) findViewById(R.id.tab2list);
lv.setAdapter(adapter);
lv.setOnItemClickListener(onClick);
EditText et = (EditText) findViewById(R.id.editText1);
et.addTextChangedListener(changeWatcher);
registerForContextMenu(lv);
}
Do you have any ideas, how XMLcode and activity code should look like in this case?