If I click on my EditText, the virtual keyboard simply will not appear. The cursor is displayed, but the keyboard is not entered.
I even tried it manually, but just didn't work.
Here is my code:
public class CreateNote extends Activity { EditText titleEdit; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.createnote); titleEdit = (EditText) findViewById(R.id.titleEdit); titleEdit.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { InputMethodManager imm = (InputMethodManager) CreateNote.this .getSystemService(Service.INPUT_METHOD_SERVICE); imm.showSoftInput(titleEdit, 0); } }); } }
Layout Fragment:
<FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#989898" > <EditText android:id="@+id/titleEdit" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/edittextdrawale" android:ems="10" android:textColor="#fff" android:textColorHint="#fff" > <requestFocus /> </EditText> </FrameLayout>
What could be the reason for playing hide and seek on my virtual keyboard? I am testing on a real device, not on an emulator.
source share