how to use soft keyboard?

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

how to use soft keyboard?

Postby charles_dong » Mon Jul 06, 2009 10:30 am

my code:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public class AndroidTest extends Activity {
  2.  
  3.     /** Called when the activity is first created. */
  4.  
  5.     @Override
  6.  
  7.     public void onCreate(Bundle savedInstanceState) {
  8.  
  9.         super.onCreate(savedInstanceState);
  10.  
  11.         LinearLayout  layout = new LinearLayout(this);
  12.  
  13.         layout.setOrientation(LinearLayout.VERTICAL);
  14.  
  15.         layout.addView(new Button(this),new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
  16.  
  17.         EditText edit = new EditText(this);
  18.  
  19.         layout.addView(edit,new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
  20.  
  21.         setContentView(layout);//ttt
  22.  
  23.        
  24.  
  25.     }
  26.  
  27. }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4


when i move focus to EditText, i want the soft keyboard display ,but it does not , why?
charles_dong
Freshman
Freshman
 
Posts: 6
Joined: Mon Jul 06, 2009 10:23 am

Top

What do you mean by focus?

Postby eagsalazar » Thu Jul 09, 2009 3:40 pm

Do you mean scrolling to the edit with the trackpad or do you mean tapping on it? My understanding is that focusing is not enough, you need to tap on it to get the soft keyboard.
eagsalazar
Freshman
Freshman
 
Posts: 2
Joined: Thu Jul 09, 2009 7:02 am

Postby charles_dong » Mon Jul 13, 2009 2:21 am

Thanks!
Yes I mean tapping on it.
I got the reason: soft keyboard display need the physical keyboard closed also.
charles_dong
Freshman
Freshman
 
Posts: 6
Joined: Mon Jul 06, 2009 10:23 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 6 guests