
- Forum-Beiträge: 57
09.03.2016, 15:51:34 via Website
09.03.2016 15:51:34 via Website
Hallo Community,
ich möchte gerne die virtuelle Tastatur automatisch anzeigen lassen aber folgende Code funktioniert nicht:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
EditText popupEditText = (EditText) findViewById(R.id.test);
imm.showSoftInput(popupEditText, InputMethodManager.SHOW_IMPLICIT );
}
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
android:id="@+id/test"/>
Weiß jemand vielleicht warum?