Questions tagged android-webview

Explore the latest questions and answers asked by our top developers.

How to throw Network errors in Android WebView?

I am using Android WebView in my App. I know that there is a method onReceivedError(final int errorCode, final String description, final String failingUrl) that gets triggered in WebViewClient I know the WebView triggers it automatically when there is a Network issue such as FILE_NOT_FOUND, CONNECTION_REFUSED etc. My question is. Is there an Exception object […]

By Rohit Singh
Categorized as android, android-webview, webviewclient

java.lang.NoClassDefFoundError: Failed resolution of: Landroid/webkit/PacProcessor

Can’t really find words, my project just don’t compile from one day to another. This is what I do: I download and show a PDF, later I print it as a saved PDF to the device, then the crash comes. Here is the crash: at java.lang.Class java.lang.Class.classForName(java.lang.String, boolean, java.lang.ClassLoader) ( at java.lang.Class java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) […]

By Adam Varhegyi
Categorized as android, android-webview, java

Android scrolling canceles Webview move events

I have Android activity with NestedScrollView and inside it I have Webview with some html and jQuery script. <FrameLayout xmlns:android="" xmlns:app="" xmlns:tools="" android:layout_width="match_parent" android:layout_height="match_parent"> < xmlns:android="" xmlns:app="" xmlns:tools="" android:id="@+id/main_content" android:layout_width="match_parent" android:layout_height="match_parent"> < android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/main_scroller" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> … some other components … <WebView android:id="@+id/web_view" android:layout_width="match_parent" android:layout_height="wrap_content" /> </LinearLayout> </> </> </FrameLayout> In […]

why is pdf from internal storage not showing in webview

I have a .pdf file (which can change content daily, so must be downloaded daily) on my server which is downloaded to the device using Volley. The api uses authentication tokens. I can successfully call the web service and write the pdf (byte[]) to my app’s internal storage by using context.getExternalFilesDir. The problem i am […]

By turtleboy
Categorized as android, android-webview

Inject value Html javaScript EditText field from android webview is getting empty on button click

I am trying to inject value from the android web view in the EditText field after injection, clicking on a button to download a file from android. The value gets empty and the website says to enter a value. I’m able to inject EditField from android on the whole page, So the problem is the […]

By Akash Kumar
Categorized as android, android-webview, inject, javascript, webview

How to expose objects/properties to JavaScript via AddJavascriptInterface

I know that I can expose a "jsBridge" object to javascript in webview by Control.AddJavascriptInterface(new JsBridge(), ‘jsBridge’); It seems inside the "JsBridge" class, we can only expose methods like [JavascriptInterface] [Export("myMethodName")] public void MyMethod(string message) { //some logic } But I need some way to expose some objects or properties like bellow: public ApiModule1 Module1 […]

By NextStep
Categorized as android, android-webview, webview,, xamarin.forms

Webview works on android 11 device but not android 6.0

I am working on updating a legacy digital signage device which uses android tv 6.0 as its base operating system. The basic use of the app is a webview which displays the signage in full screen. In this updated iteration, our signage now contains javascript (bootstrap 5 and its dependencies to be specific). I have […]

By arc-menace
Categorized as android, android-tv, android-webview

Android WebView Load Websites Into Cache From Background / WorkManager Thread

I need to preload a specific URL into the cache of my WebView from a background thread. To be more specific, I want to schedule a periodic WorkManager task that once per day refreshes that specific URL inside the WebView cache. The problem is that I have no access to a UI thread, when the […]

By J Hegg
Categorized as android, android-webview, android-workmanager, java, kotlin

When webview is load, shouldOverrideUrlLoading trigger automatically and open new activity

here is code about shouldOverrideUrlLoading that triggered automatically and open QuestionActivity.class activity when app started. @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if(url.startsWith(domain_name)){ Intent intent = new Intent(view.getContext(), QuestionActivity.class); intent.putExtra("url", url); view.getContext().startActivity(intent); getActivity().overridePendingTransition(R.anim.slide_in_right,R.anim.slide_out_left); }else{ Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); startActivity(browserIntent); } return true; }; public void onReceivedError(WebView view, int errorCode, String description, String […]

Android WebView video custom view content is off center after rotation

When the user clicks the full screen button on a video in a WebView, WebChromeClient calls onShowCustomView with the custom video view. I use this callback to add the view to a fragment and display it full screen. In a comment on a previous question, it was suggested that I include ‘orientation’ in the android:configChanges […]

1 2 3 69

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us