2013-01-21 79 views
0

我使用以下代碼在webview上加載後顯示軟鍵盤。但它不起作用。任何幫助將不勝感激。在電話上沒有顯示的軟鍵盤

 public void onCreate(Bundle savedInstanceState) 
     { 

      super.onCreate(savedInstanceState); 
      super.loadUrl("file:///android_asset/www/index.html"); 

      InputMethodManager mgr = (InputMethodManager) this.getSystemService(Context.INPUT_METHOD_SERVICE); 

      mgr.showSoftInput(this.appView, InputMethodManager.SHOW_IMPLICIT); 

      ((InputMethodManager) this.getSystemService(Context.INPUT_METHOD_SERVICE)).showSoftInput(this.appView, 0); 

      //NOTE: this code should be called after loadurl : disable the default 'save image as' and 'text selection' android dialog boxes on long clicks 
      this.appView.setOnLongClickListener(new OnLongClickListener() { 
       @Override 
       public boolean onLongClick(View v) { 
        return true; 
       } 
      }); 
      this.appView.setLongClickable(false); 

     } 

回答