2011-05-23 80 views

回答

4

您可以使用此的onResume:

InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); 
imm.showSoftInput(((EditText) findViewById(R.id.your_view)),InputMethodManager.SHOW_FORCED); 

我建議你檢查是否有你強制鍵盤出現之前硬件鍵盤。

要隱藏:

((InputMethodManager) YourActivity.this.getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(findViewById(R.id.YOUR_VIEW).getWindowToken(), 0); 

編輯:

試試這個:

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE); 
+0

這並不遺憾的是工作。 – 2011-05-23 23:00:16

+0

你在哪裏打電話? – neteinstein 2011-05-23 23:39:45

+0

我在onResume和onStart上試過它 – 2011-05-24 11:35:03

相關問題