Skip to content

Commit

Permalink
Fixed: Fix "android.view.WindowManager$BadTokenException: Unable to a…
Browse files Browse the repository at this point in the history
…dd window exception" when switching to landscape mode
  • Loading branch information
agnostic-apollo committed Sep 5, 2021
1 parent e0d184e commit d0e8805
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ private void checkIfPluginHostHasPermissionRunCommand() {
}

private void processExecutablePath(String executable) {
if (mExecutablePathText == null) return;
if (mExecutablePathText == null || mExecutablePathText.getWindowToken() == null) return;

boolean validate = true;
boolean executableDefined = true;
Expand Down Expand Up @@ -417,12 +417,12 @@ else if (executablePathText.startsWith("$PREFIX/") || executablePathText.startsW
executableFileNamesAdaptor.clear();
executableFileNamesAdaptor.addAll(new ArrayList<>(Arrays.asList(executableFileNamesList)));
executableFileNamesAdaptor.notifyDataSetChanged();
if (mExecutablePathText.isFocused())
if (mExecutablePathText.isFocused() && mExecutablePathText.getWindowToken() != null)
mExecutablePathText.showDropDown();
}

private void processWorkingDirectoryPath(String workingDirectory) {
if (mWorkingDirectoryPathText == null) return;
if (mWorkingDirectoryPathText == null || mWorkingDirectoryPathText.getWindowToken() == null) return;

boolean validate = true;
boolean workingDirectoryDefined = true;
Expand Down Expand Up @@ -537,7 +537,7 @@ else if (workingDirectoryPathText.startsWith("$PREFIX/") || workingDirectoryPath
workingDirectoriesNamesAdaptor.clear();
workingDirectoriesNamesAdaptor.addAll(new ArrayList<>(Arrays.asList(workingDirectoriesNamesList)));
workingDirectoriesNamesAdaptor.notifyDataSetChanged();
if (mWorkingDirectoryPathText.isFocused())
if (mWorkingDirectoryPathText.isFocused() && mWorkingDirectoryPathText.getWindowToken() != null)
mWorkingDirectoryPathText.showDropDown();
}

Expand Down

0 comments on commit d0e8805

Please sign in to comment.