Home » Android » android – webviewglue nativedestroy view

android – webviewglue nativedestroy view

Posted by: admin April 23, 2020 Leave a comment

Questions:

I am opening the browser at a page from my app, the code for opening the browser is one I have used many times, but in this particular case, the browser never opens.

I keep getting the following messages at the end in logcat:

09-27 15:41:16.624: INFO/ActivityManager(1644): Starting: Intent { act=android.intent.action.VIEW dat=http://www.nyt.com cmp=com.android.browser/.BrowserActivity } from pid 9332
09-27 15:41:16.634: WARN/ActivityManager(1644): Duplicate finish request for HistoryRecord{4097ec10 com.test/com.test.MainScreen}
09-27 15:41:16.684: VERBOSE/http(4606): 15326478 main RequestQueue.resetWifiProxy, wifiProxy is null
09-27 15:41:16.684: ERROR/http(4606): RequestQueue.setProxyConfig, wifiProxy is null
09-27 15:41:16.784: DEBUG/webviewglue(4606): nativeDestroy view: 0x562af8

This is a part of a huge app with a native library.

This is the snippet that opens the browser:

String afterSubmitAction = "http://www.nyt.com";

Uri uri = Uri.parse(afterSubmitAction);
startActivity(new Intent(Intent.ACTION_VIEW, uri));
finish();
How to&Answers:

Your code is working fine at my side.So please check your internet connection.Please run your code on Edge if you are using wifi to check what cause this problem.

Answer:

I don’t know how to add a comment to your post..

What happens if you comment out the finish(); ?
If the Browser doesn’t close, then it’s was because you finished the parent activity.

Try this?

String afterSubmitAction = "http://www.nyt.com";

Uri uri = Uri.parse(afterSubmitAction);
Intent i = new Intent(Intent.ACTION_VIEW, uri);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(i);