Closed thangluutitan closed 7 years ago
Locale locale = new Locale("us", "JP"); mCurrencyEditText.setLocale(locale);
This should help , but I not sure. Try instead "us" to choose another language. Сlass Locale is final to not be able to extends your
sorry for my english
Trying to reset the value on certain condition, but unfortunately its not working . CurrencyEditText mText; mText.setText("")
Please let me know, how to set this value.
You should be able to just pass in whatever value you want to setText (cast as a string) and the formatter will take care of it. So for example:
int amount = 1000;
CurrencyEditText cet = (CurrencyEditText) findViewById(R.id.myCET);
cet.setText(amount.toString());
Make sure you're obtaining a reference to the actual view. If the example you posted is out how you're trying to do it, you're going to get a null pointer exception every time as mText hasn't been initialized.
I have switch mode for two different tab. Whenever I switch mode, I use to clear the text as, private CurrencyTextEdit mAddValue; mAddValue = = (CurrencyTextEdit)findViewById(R.id.add_value); ...... switchMode(int mode) { mAddValue.requestFocus(); mAddValue.setText(""); ........ }
I am not able to get any success with any EditText call to clear the text such as , mAddValue.getText().clear() OR mAddValue.setText(""). I tried with to put this work under runnable to execute in separate thread as well, but no success.
Closing this as the outstanding issue of setting an empty value to reset the view is a duplicate of issue #24
"," can auto, but must allow input "."