Focusable EditText inside ListView

后端 未结 13 2360
无人共我
无人共我 2020-11-21 23:56

I\'ve spent about 6 hours on this so far, and been hitting nothing but roadblocks. The general premise is that there is some row in a ListView (whether it\'s g

13条回答
  •  太阳男子
    2020-11-22 00:05

    this post was matching exactly my keywords. I have a ListView header with a search EditText and a search Button.

    In order to give focus to the EditText after loosing the initial focus the only HACK that i found is:

        searchText.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View arg0) {
                // LOTS OF HACKS TO MAKE THIS WORK.. UFF...
                searchButton.requestFocusFromTouch();
                searchText.requestFocus();
            }
        });
    

    Lost lots of hours and it's not a real fix. Hope it helps someone tough.

提交回复
热议问题