When re-opening app the keyboard comes up on its own

Put your problem here if it does not fit any of the other categories.

When re-opening app the keyboard comes up on its own

Postby kidalex » Tue Jun 22, 2010 10:07 am

I'm very new to this. But I'm developing my first app. I've installed it on my Droid Incredible and opened it up. I set a focus on a text field ( AutoCompleteTextView ) and the keyboard came up as it should. Then I closed the app and opened it again but the keyboard was still there and the focus was on the text field still.

I tried entering this code in the beginning of onCreate to get rid of the keyboard:

ACTV.clearFocus();

((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(ACTV.getWindowToken(), 0);

Can somebody tell me what I'm doing wrong?
kidalex
Developer
Developer
 
Posts: 42
Joined: Tue Jun 22, 2010 10:03 am

Top

Re: When re-opening app the keyboard comes up on its own

Postby anarche » Wed Jun 23, 2010 1:05 am

That should work...

Try setting the focus to another View in the heirachy - say the parent view ACTV.getParent().requestFocus()
anarche
Master Developer
Master Developer
 
Posts: 369
Joined: Sun Apr 11, 2010 5:21 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Exabot [Bot] and 20 guests