Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

385
Views
Bloqueo de la vista web de Android "Señal fatal 5 (SIGTRAP)"

Tengo una aplicación con vista web en la que cargo contenido HTML con JavaScript habilitado. La vista web está dentro de un fragmento.

Así es como inicializo la vista web dentro del método onCreateView del fragmento:

 WebView webview = (WebView) mainView.findViewById(R.id.webview); WebSettings webSettings = webview.getSettings(); webSettings.setJavaScriptEnabled(true); webSettings.setDisplayZoomControls(false); webSettings.setLoadsImagesAutomatically(true); webSettings.setBuiltInZoomControls(true); webSettings.setDomStorageEnabled(true); webSettings.setSupportMultipleWindows(true); webview.setWebViewClient(new WebViewClient() { @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); /* * My code */ } }); webview.setWebChromeClient(new WebChromeClient() { @Override public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) { WebView.HitTestResult result = view.getHitTestResult(); String data = result.getExtra(); if (data != null) { Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(data)); startActivity(browserIntent); } return false; } }); webview.loadDataWithBaseURL(baseUrl, htmlData, "text/html", "utf-8", "");

En la vista web, un mapa se carga con JavaScript. En este mapa, podemos hacer clic en elementos y cargar fotos. Al hacer clic, la foto se muestra en una ventana emergente (todavía dentro de la vista web). Cuando hago clic en el botón Atrás para volver al mapa, la aplicación falla.

GIF del accidente en la aplicación

Aquí está el registro de errores:

A/libc: Señal fatal 5 (SIGTRAP), código 1 en tid 949 (Chrome_InProcRe) [ 03-21 11:26:08.510 364: 364 W/ ] depurado: solicitud de manejo: pid=32610 uid=10289 gid=10289 tid= 949

Probé y obtuve el bloqueo en Android 7.1.1, 6.0.1, 5.0.2. Luego probé con Android 4.4.2 y la aplicación no fallaba.

Cuando hago clic en el botón Atrás (como podemos ver en el GIF), debería volver al estado anterior con la ventana emergente cerrada

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Intente anular la funcionalidad de navegación hacia atrás y cierre la ventana emergente usted mismo.

No necesita manejar toda la lógica de navegación de la pila, solo tenga un estado cuando muestre esta ventana emergente. Aplique su propia lógica de navegación (como cerrar manualmente la ventana emergente).

 void onBackPressed(){ if(isTheBuggyPopupIsOn){ closeTheBuggyPopup(); } else{ super.onBackPressed(); } }
about 4 years ago · Santiago Trujillo Report

0

Prueba esto....

Primero agrega esto

 webView.setWebViewClient(new MyBrowser());

y luego agrega esto

 public class MyBrowser extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { // TODO Auto-generated method stub if (url.equals(""YOUR URL)) { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); startActivity(intent); return true; } else { return false; } } }
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!