Skip to content

Commit

Permalink
Custom prompt now shows the soft keyboard.
Browse files Browse the repository at this point in the history
  • Loading branch information
Grahack committed Feb 16, 2015
1 parent 2ca2a84 commit cfa8c23
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/src/main/java/info/microalg/android/DisplayResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.WindowManager;
import android.webkit.JsPromptResult;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
Expand Down Expand Up @@ -94,7 +95,7 @@ public boolean onJsPrompt(WebView view, String url, String message,
final EditText et = new EditText(view.getContext());
et.setSingleLine();
et.setText(defaultValue);
new AlertDialog.Builder(view.getContext())
AlertDialog dialog = new AlertDialog.Builder(view.getContext())
.setTitle(R.string.app_name)
.setMessage(message)
.setView(et)
Expand All @@ -110,7 +111,9 @@ public void onCancel(DialogInterface dialog) {
result.cancel();
}
})
.show();
.create();
dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
dialog.show();
return true;
}
});
Expand Down

0 comments on commit cfa8c23

Please sign in to comment.