Show Keyboard when search view will be in focus

时间:2016-08-31 12:30:32

标签: android searchview

I want to generate a searchview like the below image in my application with the same popup. I have already designed the same as shown in image but keyboard is not getting shown with this searchview.

enter image description here

Facebook also shows the same type popup when we click on stickers, so in Facebook when the popup is shown first time, the keyboard is hidden and searchview doesn't have focus but when we click on searchview it show the popup at the top and shows keyboard like the below image.

enter image description here

I also wants the same effect with searchview in my stickers popup, can anyone please help me.

Thanks a lot in advanced. :)

1 个答案:

答案 0 :(得分:0)

you can open keyboard forcefully like this .

InputMethodManager imm1 = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm1.showSoftInput(edtSearch, InputMethodManager.SHOW_FORCED);