我已经创建了一个带有editText的动态屏幕..但是点击后它没有显示虚拟键盘。我添加了以下代码..但仍然没有工作。
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
这也很有效
InputMethodManager im = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
im.showSoftInput(edittext, 0);
我的代码在这里...
runOnUiThread(new Runnable() {
            public void run() {
                LinearLayout findViewById = (LinearLayout) findViewById(R.id.dynamicInputs);
                //TextView textView = (TextView) findViewById(R.id.name);
                TextView textView = new TextView(Activity_UserInput.this);
                textView.setText("   " + map.get(KEY_NAME) + " :");
                textView.setTextColor(Color.BLACK);
                textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 17);
                //textView.setLayoutParams(new LayoutParams(Layout.DIR_LEFT_TO_RIGHT, Gravity.CENTER_VERTICAL));
                findViewById.addView(textView);
                EditText editText = new EditText(Activity_UserInput.this);
                editText.setText("");
                //editText.setInputType(InputType.TYPE_CLASS_NUMBER);  
                findViewById.addView(editText);
            }