I tried to implement search using EditText. whenever a text is typed in the EditText request is sent with the typed text in onTextChanged()
You need to override onConfigurationChanged method to get callback whenever orientation is getting changed.
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
// landscape
} else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
// portrait
}
}
Add below line in manifest
android:configChanges= "orientation"
Now based on the callback you can do whatever you wanted to do.