3

I am trying to port the android application(2.3.3) to BB 10,Presently input=number,is not showing numeric keypad,even though it filters appropriately,I tried list of methods to make it programmatically work or make some modifications in XML.

While modifying xml file, I was able to get the password=true,it filters numeric keypad on top of the other keypads, but still unable to figure out for some other non password keypads as well.

Similarly I tried modifying password as well setting programmatically, but none of these worked, below is the list of things that I tried programmatically, but none of them served my purpose.

  myNumber= (EditText) findViewById(R.id.ActivateNewUser_myNumber);
  myNumber.setInputType(InputType.TYPE_CLASS_NUMBER);
  myNumber.setRawInputType(Configuration.KEYBOARD_12KEY);
  myNumber.setKeyListener(new DigitsKeyListener());
  myNumber.setOnClickListener(this);
  myNumber.setTransformationMethod(PasswordTransformationMethod.getInstance());
  myNumber.setTransformationMethod(null);
  myNumber.setInputType(InputType.TYPE_CLASS_TEXT );
  myNumber.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
  myNumber.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);
  myNumber.setInputType(InputType.TYPE_CLASS_TEXT | inputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
  myNumber.requestFocus();
  InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
  imm.showSoftInput(myNumber, InputMethodManager.SHOW_IMPLICIT);

Please, let me know, if I am missing something.

Narendra Singh
  • 3,990
  • 5
  • 37
  • 78
Rakesh
  • 14,997
  • 13
  • 42
  • 62
  • Have you tried creating and adding the EditText programatically? Maybe the framework doesn't support changing the input type parameter after creation. I recommend to test it at least to find out whether you should continue looking for other methods or if you need to take a non-xml approach entirely. – Nilzor Mar 22 '13 at 13:37
  • Probably a duplicate of http://stackoverflow.com/questions/14725876/numeric-keyboard-not-displaying-when-porting-android-app-to-bb10 – Marc Plano-Lesay Jul 10 '13 at 12:37
  • I believe this can help you : http://stackoverflow.com/questions/9763900/how-can-my-android-app-programmatically-display-the-keyboard/23487059#23487059 – Rana Ranvijay Singh May 06 '14 at 06:38

0 Answers0