Discussion Forums  >  WebViews and HTML for Mobile

Replies: 8    Views: 6479

Lyle @SFNeNT
buzztouch Evangelist
Profile
Posts: 168
Reg: Apr 29, 2011
Chicago, IL
2,830
10/26/13 01:49 PM (10 years ago)

Webview button click not working in Android

When i load a URL in webview everything works great but my upload button on my site. Works in Androids native browser but not when its in webview. When i click the upload button on native browser a dialog box will appear giving me the option to open my camera, gallery, or file explorer. When i do the same in webview i get a orange box and the dialog box never loads. Do I need to modify the BT_Screen_CustomURL.java file or is this a CSS issue. I've looked into this already http://stackoverflow.com/questions/4078018/how-to-disable-the-orange-circle-effect-when-clicking-on-a-link-in-a-webview Thanks in advance any thoughts.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
10/26/13 02:45 PM (10 years ago)
Are you using BT 'new' Android or BT 'old' android? The 'new' android Webview plugin is written to take advantage of the Users preferred Native Viewer, and will prompt them to choose when the screen becomes visible. The 'old' android would display the page within the webview natively. Cheers! -- Smug
 
Lyle @SFNeNT
buzztouch Evangelist
Profile
Posts: 168
Reg: Apr 29, 2011
Chicago, IL
2,830
like
10/26/13 03:34 PM (10 years ago)
New Android core 3.0
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
10/26/13 03:43 PM (10 years ago)
Then, without any modification to the plugin, the 'expected' behavior is, you would list the desired URL or filename in the control panel. When the screen opens on your device, you'll see a button that says 'open' (or similar). Pressing that button gives the user the option to choose the desired viewer for the document. I don't actually like that behavior; the old Android would display it natively. This (to me) adds another step that isn't needed. I kind of modified an old version to work with the new code, but I don't support it. I just got it working enough to satisfy my own needs. There is more work that can be done on it... https://dl.dropboxusercontent.com/u/115208762/Sw_smugwebview/Sw_smugwebview.zip But you're welcome to try it if you think it can help. Cheers! -- Smug
 
Lyle @SFNeNT
buzztouch Evangelist
Profile
Posts: 168
Reg: Apr 29, 2011
Chicago, IL
2,830
like
10/26/13 05:14 PM (10 years ago)
This better explains the issue iI am having, but in my situation i haven't even been able to get as far as he did http://stackoverflow.com/questions/15725814/upload-an-image-from-camera-or-gallery-in-webview
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
10/26/13 07:16 PM (10 years ago)
Then you may want to modify your plugins to use the webview as the viewer. That is what I did with my plugin (listed above). Cheers! -- Smug
 
Lyle @SFNeNT
buzztouch Evangelist
Profile
Posts: 168
Reg: Apr 29, 2011
Chicago, IL
2,830
like
10/29/13 10:05 PM (10 years ago)
Found this to work "setDomStorageEnabled(true)" added to the main activity.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
10/29/13 10:12 PM (10 years ago)
Oh yeah? Cool :) Glad it's working! I'll have to look that up; my Android lacks at times, lol! Cheers! -- Smug
 
DENIS_
Aspiring developer
Profile
Posts: 8
Reg: May 10, 2014
MONACO
1,180
like
09/22/15 08:45 AM (8 years ago)
Hello, probably a stupid question, where do you find setDomStorageEnabled ?
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.