Closed
Description
Hello,
First off thanks for the library, it looks great! I think I have found an issue affecting only Android 7.X Nougat devices.
Scenario
- The first Fragment in my stepper has an EditText field that needs focus and to display a soft keyboard when user navigates to it.
My code to accomplish this looks like:
@Override
public void onSelected() {
templateNameEditText.post(new Runnable() {
@Override
public void run() {
templateNameEditText.requestFocus();
InputMethodManager inputMethodManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.showSoftInput(templateNameEditText, InputMethodManager.SHOW_IMPLICIT);
}
});
}
This is working wonderfully on every android device down to Android 4.4 KitKat but inconsistently on Android 7.X.
Suspected Cause
- Line 774 in
onUpdate(...)
ofStepperLayout.java
hasStep step = mStepAdapter.findStep(newStepPosition);
and I have seen only on Nougat devices that this method is sometimes returningnull
Steps to Reproduce
- Add a Fragment that implements
Step
- Add a
Log
statement or line of code to attach debugger in@Override public void onSelected() {}
- Verify
onSelected
is not called on every navigation to Fragment
Expected Result
mStepAdapter.findStep(newStepPosition);
should not be null andonSelected
should be called each time user navigates to Fragment on Android Nougat devices
Metadata
Metadata
Assignees
Labels
No labels