How to specify minimum and / or maximum length in RemoteInput

I use RemoteInput in my Android N notifications.

I want to set the minimum and maximum value of the text length for input.

Google Hangouts got this (i.e. the submit button allows when a user enters at least 1 character). Does anyone know how to do this? I tried to check Android docs but no luck.

+8
android notifications
source share
2 answers
button.setClickable(false); button.setEnabled(false); editText = (EditText)findViewById(R.id.editText); editText.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { button.setClickable(true); button.setTextColor(getResources().getColor(R.color.colorPrimary)); // TODO Auto-generated method stub } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { // TODO Auto-generated method stub } @Override public void afterTextChanged(Editable s) { // TODO Auto-generated method stub } }); } 
+5
source share

Try implementing a notification with a custom view. And include in it all the logic you need. For me, this is one of the ways ((

0
source share

All Articles