android-webview

webview opens default browser, I don't know where to put code

ぐ巨炮叔叔 提交于 2020-01-02 08:44:49
问题 So, I've been Googleing around for 4 hours now :( and i cant get the website to only stay opened in the app. After you type in the username and password upon clicking log in the page opens in the default browser. What I learned is, I should use: shouldOverrideUrlLoading() but I don't know where place it and how to use it to. This is my MainActivity.java , where or what do I put in there to stop it from opening in the default browser.(ignore the * ) package com.example.***.*******c; import

webview opens default browser, I don't know where to put code

这一生的挚爱 提交于 2020-01-02 08:43:20
问题 So, I've been Googleing around for 4 hours now :( and i cant get the website to only stay opened in the app. After you type in the username and password upon clicking log in the page opens in the default browser. What I learned is, I should use: shouldOverrideUrlLoading() but I don't know where place it and how to use it to. This is my MainActivity.java , where or what do I put in there to stop it from opening in the default browser.(ignore the * ) package com.example.***.*******c; import

Viewing Excel files in my Android App through API

为君一笑 提交于 2020-01-02 07:27:11
问题 I want to view excel files in my own Android App. Currently, using my App I can see all google docs. But after clicking on any one doc (for e.g Excel file 'myDemo.xls') , I want to open it in my own app (For Viewing purpose). I have read about jxl but the problem with this is that it parses the xls file & the file should be stored in the SD Card. In my case it is stored in the google drive. (not on SD card) Here is similar question. Is there any other way to view xls file through any other

File chooser dialog not opening in android webview if “display:none”

前提是你 提交于 2020-01-02 03:56:05
问题 Good morning developers Well I have made an android webview application, I m facing a little issue, I searched alot but couldn't found any valid solution. Ok. the problem is that. I have a php/Html code like this <input type="file" name="banner_image" style="display:none;" id="banner_image" onChange="fileSelected('banner');" accept="image/*" /> Notice: the style="display:none;" I m calling the onclick event of input field from onClick of a div via Jquery like this <div class="profile-pic-txt"

Remediation for JavaScript Interface Injection Vulnerability

时间秒杀一切 提交于 2020-01-02 03:37:10
问题 I received a warning from Google Play Console that refers me to this page because I used JavaScript Interface in my app and suggest two options to solve the problem . Option 1 tells : Ensure that there are no objects added to the JavaScript interface of any WebView that loads untrusted web content. You can do this in two ways: Ensure that no objects are ever added to the JavaScript interface via calls to addJavascriptInterface. Remove objects from the JavaScript interface in

How to handle shouldInterceptRequest parameter change in API21?

北城以北 提交于 2020-01-02 03:27:09
问题 In API21 Google modified shouldInterceptRequest method to use WebResourceRequest request instead of String url . Is there any way I could write a generic class extending WebViewClient and handle both methods? My minimum API version is 18. Thanks Krystian 回答1: Google modified shouldInterceptRequest method to use WebResourceRequest request instead of String url No, they added a second shouldInterceptRequest() method. Both are available in API Level 21+; the String variant is available on API

UiAutomator getLastTraversedText()

*爱你&永不变心* 提交于 2020-01-02 02:24:05
问题 I was trying to test an Android Webview using Android UiAutomator. As I understand the documentation, scrolling through a WebvView would generate UI traversal events, and those should be readable via getUiDevice().getLastTraversedText(). However, when I use getUiDevice().pressDPadDown() to scroll through a web view, getUiDevice().getLastTraversedText() keeps returning null. What have I missed? If anyone has gotten this call to work I would very much appreciate a short code sample. 回答1: Bad

Disabling email,number detection in android WebView

柔情痞子 提交于 2020-01-01 19:58:11
问题 I'm developing an app with phonegap+sencha touch2+android. I've one panel showing various content that contains emails, some numbers in textual form. As it's a WebView when I tap on number, andorids default MailCompose Activity starts, when I tap on number Dialer Activity starts. How can I disable this from happening. Is there some config I'm missing from android side before loading url or web settings for WebView. Or something from Phonegap because when I saw log cat it shows following line

I am trying to block facebook on system browser

旧时模样 提交于 2020-01-01 19:31:08
问题 For this,first i am getting the top activity from the stack and then matching the string of Facebook in logcat.. I am using this Code, public class MyService extends Service { public static String Tag = "Task"; public static String Tag1 = "Top Running Task"; ActivityManager am ; String packageName ; Handler handler; int count=0; @Override public int onStartCommand(Intent intent,int flags, int startId) { // TODO Auto-generated method stub super.onStartCommand(intent, flags,startId); Toast

Android: How to split Picture captured from webview in multiple images

别等时光非礼了梦想. 提交于 2020-01-01 18:13:49
问题 I have a webview and I capture the view like this Picture picture = m_browser.capturePicture(); Bitmap b = Bitmap.createBitmap( picture.getWidth(), picture.getHeight(), Bitmap.Config.ARGB_8888); Canvas c = new Canvas( b ); picture.draw( c ); FileOutputStream fos = null; try { fos = new FileOutputStream("/sdcard/temp_1.jpg"); //fos = openFileOutput("samsp_1.jpg", MODE_WORLD_WRITEABLE); if ( fos != null ) { b.compress(Bitmap.CompressFormat.JPEG,90, fos); fos.close(); } } catch (Exception e) { /