2011-05-23 58 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

相关问题