Stopping soft keyboard from displaying

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Stopping soft keyboard from displaying

Postby Draffodx » Wed Jan 13, 2010 5:47 pm

I'm wondering if anyone can point me in the right direction as how to stop the soft keyboard from popping up on the running of an activity.

I have an activity that displays several EditTexts that the user can change and then save the changes,

However when the activity is run the softkeyboard automatically pops up as the first EditText gets focus and takes up over half the screen (see attached pic)

I want the screen to display without the soft keyboard first so the user can see the options and then the soft keyboard to be displayed when the user clicks into an EditText.

Anyone know of any tutorials or what is supplied by Android to control the soft keyboard?

I came across some inputmethod stuff but I'm not sure thats the right thing to be looking at?
Attachments
screenup.png
screenup.png (38.56 KiB) Viewed 214 times
Draffodx
Master Developer
Master Developer
 
Posts: 205
Joined: Wed Nov 12, 2008 2:31 pm

Top

try this

Postby gulrich » Wed Jan 13, 2010 7:49 pm

this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

I've been using this in just such a case. Hide the keyboard until the user touches the edittext view.
gulrich
Freshman
Freshman
 
Posts: 5
Joined: Sun Dec 27, 2009 9:34 pm

Postby Crw » Wed Jan 13, 2010 8:26 pm

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. <EditText Name>.setInputType(0);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4

works fine for me.
Crw
Freshman
Freshman
 
Posts: 2
Joined: Wed Jan 13, 2010 10:52 am

Postby gulrich » Wed Jan 13, 2010 8:30 pm

Crw wrote:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. <EditText Name>.setInputType(0);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4

works fine for me.


I tried this but it made the edittext view uneditable. That is, touching the edittext view did not cause the keyboard to show. This made it impossible to enter text on a device with no soft keyboard. I only tested this on 1.5 though.
gulrich
Freshman
Freshman
 
Posts: 5
Joined: Sun Dec 27, 2009 9:34 pm

Postby Draffodx » Thu Jan 14, 2010 2:51 pm

Thanks Gulrich that worked perfectly
Draffodx
Master Developer
Master Developer
 
Posts: 205
Joined: Wed Nov 12, 2008 2:31 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 8 guests