Skip to content

Commit

Permalink
Merge pull request #230 from learningequality/fix_loading_pag
Browse files Browse the repository at this point in the history
Fix loading of html loading page.
  • Loading branch information
bjester authored Jul 29, 2024
2 parents 929214a + 972b7dc commit c4d378f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.util.List;
import java.util.ArrayList;

import android.util.Base64;
import android.view.ViewGroup;
import android.view.KeyEvent;
import android.app.Activity;
Expand Down Expand Up @@ -173,7 +174,9 @@ public void onClick(DialogInterface dialog,int id) {
webViewSettings.setMediaPlaybackRequiresUserGesture(false);
webViewSettings.setMediaPlaybackRequiresUserGesture(false);

mWebView.loadData(PythonActivity.mActivity.getString(R.string.loading_page_html), "text/html", "UTF-8");
String unencodedHtml = PythonActivity.mActivity.getString(R.string.loading_page_html);
String encodedHtml = Base64.encodeToString(unencodedHtml.getBytes(), Base64.NO_PADDING);
mWebView.loadData(encodedHtml, "text/html", "base64");
mWebView.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
mWebView.setWebViewClient(new WebViewClient() {
@Override
Expand Down

0 comments on commit c4d378f

Please sign in to comment.