mirror of
https://github.com/AeThex-Corporation/AeThex-OS.git
synced 2026-04-17 22:27:19 +00:00
fix(webview): disable hardware acceleration to fix black screen rendering
This commit is contained in:
parent
823804c0bf
commit
504876ee72
1 changed files with 7 additions and 3 deletions
|
|
@ -14,6 +14,8 @@ import android.util.Log;
|
|||
|
||||
import android.os.Handler;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
public class MainActivity extends BridgeActivity {
|
||||
|
||||
@Override
|
||||
|
|
@ -29,11 +31,13 @@ public class MainActivity extends BridgeActivity {
|
|||
WebView webView = this.bridge.getWebView();
|
||||
|
||||
runOnUiThread(() -> {
|
||||
Toast.makeText(MainActivity.this, "Resetting & Loading...", Toast.LENGTH_SHORT).show();
|
||||
// DISABLE HARDWARE ACCELERATION - Common fix for black screens on specific devices
|
||||
webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
|
||||
Toast.makeText(MainActivity.this, "Software Rendering Enabled", Toast.LENGTH_SHORT).show();
|
||||
});
|
||||
|
||||
// Set WebView background to BLACK
|
||||
webView.setBackgroundColor(0xFF000000);
|
||||
// Set WebView background to BLUE to distinguish from default black
|
||||
webView.setBackgroundColor(0xFF0000FF);
|
||||
|
||||
WebSettings settings = webView.getSettings();
|
||||
settings.setJavaScriptEnabled(true);
|
||||
|
|
|
|||
Loading…
Reference in a new issue