Question

I have been so much tired while searching for a solution to bring the suggestion list in front of the keyboard.

Suggestion List is behind Keyboard

There are more suggestions behind the keyboard. I want to be able to see these suggestion when I touch/scroll this list by bringing the list in front of the keyboard. I have checked many similar question but without any hope to efficiently do so. The suggestion made on THIS QUESTION does not solve the problem for all devices. I have also seen THIS QUESTION but it didn't help solve the problem.

Is there any suggestion how to solve this issue.

No correct solution

OTHER TIPS

This is due to a layout problem. Basically your keyboard has the focus because the user is writting, but you want to show the dropdown list. But if you see the dropdown list, you won't see the keyboard and the user will have to focus the EditText each time they want to keep writing. So basically the behavior you're seeing is the correct IMO.

You have 2 options here:

1) Change your layout so the Help Center shows from the very top of the screen and has a sufficient height to show all its suggestions.

2) Limit the dropdown items to show. Since there's no native way of achieving this, as there's no maximumSuggestions option, you can get the height of one of the rows and multiply it X times (being X the number of rows to show) and use setDropDownHeight() to set its height. More info on this here.

public View getView(final int position, View convertView, ViewGroup parent) {

    LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    ViewHolder holder;
    if (convertView == null) {
        convertView = inflater.inflate(viewResourceId, parent, false);
        holder = new ViewHolder();
        init(convertView, holder);
        convertView.setTag(holder);
    } else {
        holder = (ViewHolder) convertView.getTag();
    }

    convertView.setOnTouchListener(new View.OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {

            if (event.getAction() == MotionEvent.ACTION_DOWN) {
                InputMethodManager imm = (InputMethodManager) getContext()
                        .getSystemService(
                                Context.INPUT_METHOD_SERVICE);
                imm.hideSoftInputFromWindow(
                        searchView.getWindowToken(), 0);
            }

            return false;
        }
    });

    setView(position, holder);
    return convertView;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top