2

I tried using the accepted answer here but this does not work for me!

android - show soft keyboard on demand

Any advice is appreciated :)

Community
  • 1
  • 1
Ahmed Faisal
  • 4,397
  • 12
  • 45
  • 74
  • Post your code. Everything I have read says that your link should work. – Phil Aug 23 '11 at 15:55
  • 1
    Oh I forgot to mention, my editText is part of a titleLayout that I am including in this activity. i.e in the first (landing)activity of the main-tabbed-activity, the softkeyboard shows up when the editText is selected. But if I go to the second activity in the main-tabbed-activity w/o using the softkeyboard in the first instance, the softkeyboard does not show up! – Ahmed Faisal Aug 23 '11 at 16:02
  • In what way is it not working? Can you provide a bit more detail to your question - i.e. the code you are using and the actual outcome? – seanhodges Aug 23 '11 at 16:03
  • Thank you for your answers. I finally go it to work. All I had to do was to clear the focus when I navigate from one activity to another. :) Thank you once again! – Ahmed Faisal Aug 23 '11 at 16:15

2 Answers2

1

how about this:

 activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
serkanozel
  • 2,947
  • 1
  • 23
  • 27
0

This line of code (which seems so obvious now) did the trick:

editText.clearFocus();
Ahmed Faisal
  • 4,397
  • 12
  • 45
  • 74