-1

My activity is panned in order to make space for soft keyboard(keyboard is visible).

When I leave activity in this state by pressing home button, after return to this activity, layout remains panned, but keyboard is not shown. I'd love keyboard to be shown in this situation, or layout to slide down. Can somebody please help me, how to do that?

I don't want to use android:windowSoftInputMode="stateVisible" because I don't want keyboard to be shown by default.

Kara
  • 5,650
  • 15
  • 48
  • 55
Berťák
  • 6,819
  • 2
  • 26
  • 37
  • call the method to show the keyboard in onRestart()...!try it – mayank_droid Nov 15 '11 at 11:06
  • Thanks for reply, I tried to put it in onRestart, but it didn't work. :( Maybe I messed something else... I found out that when I make some toast in onRestart, layout slides down in situation i described and everything is ok... – Berťák Nov 15 '11 at 11:58

2 Answers2

1

So there must be some problem with fullscreen activities. When I change my activity from fullscreen to for example NoTitleBar, everything works fine.

When using fullscreen activities, the goal is to force redraw/remeasure screen in onRestart method. For this issue with fullscreen activities, I found workaround here

Community
  • 1
  • 1
Berťák
  • 6,819
  • 2
  • 26
  • 37
0

You can try this piece of code when you want to show the keyboard :

((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE))
.showSoftInput(myEditText, InputMethodManager.SHOW_FORCED);
Android-Droid
  • 13,649
  • 37
  • 107
  • 184
  • Thanks for reply, I tried to put this piece of code in onRestart, but it didn't work. :( Maybe I messed something else... I found out that when I make some toast in onRestart, layout slides down in situation i described... – Berťák Nov 15 '11 at 11:31