My application contains ViewPager and dynamically created WebView . When a captcher is displayed on the page (protected from bots) for input, when you click on the input component, the keyboard is not displayed. When I removed the ViewPager and just left WebView , the keyboard was displayed. What could be the problem?

  adapter=new BrowserPagerAdapter(pages); viewpager=new ViewPager(this); viewpager.setAdapter(adapter); viewpager.setCurrentItem(0); setContentView(viewpager); 

    1 answer 1

     /** * показываем программную клавиатуру */ protected void showInputMethod() { InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE); if (imm != null) { imm.showSoftInput(myEditText, 0); } } 

    GZV

     InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0); 
    • This is set for my own EditText, I need to display the keyboard when focusing on the EditText component of the page. - ramin
    • it's just a method, you can call it with any action - Gorets
    • hang up on it clickListener and by pressing call a method ... show the code .. - Gorets
    • the code is big, what part of the code are you interested in? In showSoftInput, what should I pass to the first parameter? - ramin
    • try better this way, updated the answer - Gorets