Search Results

Search found 534 results on 22 pages for 'webview'.

Page 1/22 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Android webview doesn't playing mp4 video in same page

    - by user1668105
    I'm trying to show one local html file contains code for playing video and try to show that html file in android webview. I've used following code to for playing video: WebViewLoadVideoActivity.java //DECLARE webview variable outside of onCreate function so we can access it in other functions (menu) @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); WebView webView = (WebView) findViewById(R.id.webView1); WebSettings webSettings = webView.getSettings(); // Fetches the // WebSettings // import WebViewClient webViewClient = new WebViewClient(); webView.setWebViewClient(webViewClient); // Enabling mp4 webSettings.setPluginsEnabled(true); // Allows plugins to run which are // normally disabled in webView webView.getSettings().setBuiltInZoomControls(true); // Allows the // Android built in // zoom control webView.getSettings().setSaveFormData(true); webView.getSettings().setLoadsImagesAutomatically(true); webView.getSettings().setPluginsEnabled(true); webView.getSettings().setLoadsImagesAutomatically(true); webView.getSettings().setSupportMultipleWindows(true); webView.getSettings().setPluginsEnabled(true); webView.getSettings().setLightTouchEnabled(true); webView.getSettings().setAllowFileAccess(true); // To allow file // downloads/streams // such as mp4, mpeg, // and 3gp files webView.getSettings().setJavaScriptEnabled(true); // Enables HTML // Javascript to run // in webview webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); webView.getSettings().setSupportZoom(true); // Support the zoom feature webView.getSettings().setSavePassword(true); // Allow users to save passwords in forms webView.setWebViewClient(new WebViewClient() { // Opens web links clicked by user in the webview @Override public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { // Handle the error } @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } }); webView.loadUrl("file:///android_asset/test.html"); // test.html file from assets folder //... Rest of activity code... test.html <!DOCTYPE html> <html> <body> <video width="320" height="240" controls="controls"> <source src="http://www.w3schools.com/html/movie.mp4" type="video/mp4" /> Your browser does not support the video tag. </video> </body> </html> Problem Area : Android webview or Android Default Browser shows the video content in another video view when we click play button, My requirement is that video should be opened in same html page inline, so user can navigate to other page of webpage during video is playing or buffering. Research Area : I tried many other ways like, video tag of HTML5 embed tag of HTML object tag of HTML Other way of video player integration i checked so far but not worked in my requirement, Flare Video jplayer Please suggest me any way that can be suitable for my requirement, And my requirement is very simple as, I want to play video in html file as inline in webview widget of android. Thanks in Advance.

    Read the article

  • "Hello, WebView" tutorial opens the requested address in Android browser and not in my webview

    - by VitalyB
    Hi everyone, I am using Android emulator with AVD of Android 2.1 and I have the following problem: Trying to load a URL in a WebView using webView.loadUrl causes it to open in the browser instead. Note: I am talking about the initial opening, not the issue in which links from the WebView open in a browser, though, perhaps it is somehow connected. I've tried several things: I've removed <uses-permission android:name="android.permission.INTERNET" /> from the manifest. That actually made it work correctly, i.e, load the html into the webview. However, as one would expect, the only thing it loaded is "unable to connect the internet" error page. I've tried downloading a real sample project ("Hello Android" book source files, project - BrowserView). However, it didn't work just the same. I've created a new project and followed the directions at Google's official tutorial of using WebView and got the same result. I haven't find anyone else complaining about it. Why does it happen? Thanks, Vitaly

    Read the article

  • Problem with "Hello, WebView" example

    - by arakn0
    Hi there, I'm new in android development and I am trying out the WebView example in the official android site. http://developer.android.com/guide/tutorials/views/hello-webview.html But I do everything they say...which is pretty simple: I create the project, edit the layout file, then i add the code, etc. No problems building...but when I launch the app in the simulator I just got a black screen. It is like if the Layout is empty...like if the WebView is not created. does anybody know what I am doing wrong? Thanks in advanced

    Read the article

  • Android adding HTML content on a webview without space

    - by Rahul
    I am trying to add an HTML content to a web view. If the words in the HTML content are without spaces then webview keeps that particular word on the same line.I want that content to be wrapped and be on the next line.Is it possible to do that.I am attaching a sample code that can reproduce the issue. String temp="<p>WebViewallowsyoutocreateyourownwindowforviewingwebpages(orevendevelopacompletebrowser).Inthistutorial,youcreateasimpleActivitythatcanviewandnavigatewebpages.1.CreateanewprojectnamedHelloWebView.</p>"; WebView wb=new WebView(this); wb.loadDataWithBaseURL("", temp, "text/html", Encoding.UTF_8.toString(),""); setContentView(wb);

    Read the article

  • Android WebView and default browser with different UserAgent

    - by Udi I
    From some reason on several android devices, I'm getting different User Agent from the browser and from my application's WebView. I have used this line of code to get the UA in the app: new WebView(this).getSettings().getUserAgentString(); This is the part with the difference The application retruns: HTC One X Build While the browser returns: HTC_One_X Build Notice the underscores in the browser's version. Any ideas what causes the difference? Tx!

    Read the article

  • NullPointerException in webview.java (android.webkit.WebView$PrivateHandler.handleMessage)

    - by PacificSky
    Every few days I get a crash report for my application with the following stack trace, or small variants thereof (with different line numbers based on different android versions) java.lang.NullPointerException at WebView.java:8241:in `android.webkit.WebView$PrivateHandler.handleMessage' Handler.java:99:in `android.os.Handler.dispatchMessage' Looper.java:150:in `android.os.Looper.loop' ActivityThread.java:4293:in `android.app.ActivityThread.main' Method.java:-2:in `java.lang.reflect.Method.invokeNative' Method.java:507:in `java.lang.reflect.Method.invoke' ZygoteInit.java:849:in `com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run' ZygoteInit.java:607:in `com.android.internal.os.ZygoteInit.main' NativeStart.java:-2:in `dalvik.system.NativeStart.main' This specific stack was on Android 2.3.4 on a HTC EVO 3D PG86100 device. My app does host several webviews for some oAuth-related login scenarios. How should I go about trying to figure out how to fix this? I've tried looking on grepcode to find the source, but I'm unable to find a matching line number that makes sense. Is my Grepcode-fu weak?

    Read the article

  • Webview shouldoverrideurlloading doesn't work

    - by Zak
    I have this code in my app: public class Home extends Activity{ @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.home); final ProgressDialog progressBar; if(isOnline()){ WebView webView = (WebView) findViewById(R.id.home_web); webView.setBackgroundColor(Color.parseColor(getString(R.color.colore_bg))); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setBuiltInZoomControls(true); webView.getSettings().setPluginsEnabled(true); webView.setWebViewClient(new MyWebViewClient()); progressBar = ProgressDialog.show(this,getString(R.string.caricamento),getString(R.string.attendere)); webView.setWebViewClient(new WebViewClient(){ public void onPageFinished(WebView view, String url) { if (progressBar.isShowing()) { progressBar.dismiss(); } } }); webView.loadUrl("http://www.mysite.com/android.php"); }else{ Toast.makeText(this,getString(R.string.no_connessione),Toast.LENGTH_LONG).show(); } } private class MyWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { System.out.println("here"); if (Uri.parse(url).getHost().equals("mysite.com")) { // This is my web site, so do not override; let my WebView load the page return false; } // Otherwise, the link is not for a page on my site, so launch another Activity that handles URLs Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); startActivity(intent); return true; } } public boolean isOnline(){ ConnectivityManager cm=(ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo ni = cm.getActiveNetworkInfo(); if(ni==null){ return false; } return ni.isConnected(); } } The shouldOverrideUrlLoading doesn't work, neither print the system.out, it seems to be never called. How can I repair this? I need to open all the link (except the main page www.mysite.com/iphone.php) in the default browser

    Read the article

  • Android WebView - cannot understand - Null or empty value for header "if-none-match"

    - by ganesh
    Hi When i tried to load a url i get an exception as below Uncaught handler: thread WebViewCoreThread exiting due to uncaught exception 06-16 10:22:31.471: ERROR/AndroidRuntime(635): java.lang.RuntimeException: Null or empty value for header "if-none-match" 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at android.net.http.Request.addHeader(Request.java:161) 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at android.net.http.Request.addHeaders(Request.java:179) 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at android.net.http.Request.<init>(Request.java:132) 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at android.net.http.RequestQueue.queueRequest(RequestQueue.java:480) 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at android.net.http.RequestHandle.createAndQueueNewRequest(RequestHandle.java:419) 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at android.net.http.RequestHandle.setupRedirect(RequestHandle.java:195) 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at android.webkit.LoadListener.doRedirect(LoadListener.java:1216) 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at android.webkit.LoadListener.handleMessage(LoadListener.java:220) 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at android.os.Handler.dispatchMessage(Handler.java:99) 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at android.os.Looper.loop(Looper.java:123) 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:471) 06-16 10:22:31.471: ERROR/AndroidRuntime(635): at java.lang.Thread.run(Thread.java:1060) the code i am using is webview = (WebView)findViewById(R.id.generalwebview); webview.getSettings().setJavaScriptEnabled(true); webview.setWebViewClient(new WebViewClient() { public boolean shouldOverrideUrlLoading(WebView view, String url) { Log.i("ReserveBooking", "Processing webview url click..."); view.loadUrl(url); return true; } public void onPageFinished(WebView view, String url) { Log.i("ReserveBooking", "Finished loading URL: " +url); } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Log.e("ReserveBooking", "Error: " + description); Toast.makeText(ReserveBooking.this, description, Toast.LENGTH_SHORT).show(); } }); webview.loadUrl(utls); and when i changed the emulator, this programs works without any error .Please help me to know the reason why i get this error ,is this error somehow related to cache? ,I shall be glad if someone explains ganesh

    Read the article

  • Android WebView shows a blank page

    - by Sara
    Trying to create a WebView but it only shows a blank/white page. I have followed several examples and they all say that work with this code... Here is my code: import android.app.Activity; import android.os.Bundle; import android.webkit.WebView; public class PostenWebView extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.web_view); WebView webview = (WebView)findViewById(R.id.webview); webview.loadUrl("http://www.google.com"); } } And here is the web_view.xml:

    Read the article

  • Restore history and current page on resuming webview

    - by qubit
    I have a webview that I use to navigate from page to page. I have implemented go back and go forward. My problem is that when I return to the webview after visiting another activity, the history is lost i.e. the webview starts again on the first page. How do I code it so that after I call finish on the webview to swap to another activity on returning to the webview, the WebBackForwardList is restored and I am taken to the page I was on when I left the webview? I have tried overriding onSaveInstanceState and onRestoreInstanceState using webview.save/restoreState(bundle) but with no success. I have achieved returning to the last page by saving the last url in preferences, but have been unable to restore the entire history.

    Read the article

  • Add two webview in framelayout

    - by user1478916
    I want to add two webview in a layout..I use frameLayout <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <WebView android:id="@+id/webview1" android:layout_width="350dip" android:layout_height="350dip" /> <WebView android:layout_height="250dip" android:layout_width="250dip" android:id="@+id/webview2" /> </FrameLayout> And in Main Activity : web1=(WebView)findViewById(R.id.webview1); web2=(WebView)findViewById(R.id.webview2); web1.loadUrl("http://www.google.com"); web2.loadUrl("http://www.youtube.com"); web2.setOnClickListener(new OnClickListener() { public void onClick(View v) { // TODO Auto-generated method stub Animation anim=AnimationUtils.loadAnimation(FrameWebViewActivity.this, android.R.anim.slide_in_left); web2.setAnimation(anim); } }); But when run project,it only display webview youtube full screen ..I want to display both two webview..What i must do??

    Read the article

  • Figuring if a link is clicked on a webView - iPhone

    - by Uygar
    Hi, I am using a custom webview to show a tabbar when user touches on the webview. But when I clicked on a link in a webview, tabbar is shown for a little time and then page loads. I am using this custom webview to detect touch: http://github.com/psychs/iphone-samples/blob/b772b963f2acf18d478b41b44555992fcd8d4f31/WebViewTappingHack/Classes/PSWebView.m Can I detect if a link clicked or not? Because a link stands on the webview, webview detects the touch and also it loads the page... I want to prevent it. Thanks in advance.

    Read the article

  • HTML inside webView

    - by Samuh
    I am posting some data to a server using DefaultHttpClient class and in the response stream I am getting a HTML file. I save the stream as a string and pass it onto another activity which contains a WebView to render this HTML on the screen: response = httpClient.execute(get); InputStream is = response.getEntity().getContent(); BufferedReader br = new BufferedReader(new InputStreamReader(is,"utf-8")); StringBuffer sb = new StringBuffer(); String line; while((line=br.readLine())!=null){ sb.append(line); sb.append("\n"); } is.close(); Intent intent = new Intent(this,Trial.class); intent.putExtra("trial",sb.toString()); startActivity(intent); Log.i("SB",sb.toString()); In Second Activity, the code to load the WebView reads: WebView browser = ((WebView)findViewById(R.id.trial_web)); browser.getSettings().setJavaScriptEnabled(true); browser.loadData(html,"text/html", "utf-8"); When I run this code, the WebView is not able to render the HTML content properly. It actually shows the HTML string in URL encoded format on the screen. Interestingly, If I copy the Loggers output to HTML file and then load this HTML in my WebView(using webview.loadurl(file:///assets/xyz.html)) everything works fine. I suspect some problem with character encoding. What is going wrong here? Please help. Thanks.

    Read the article

  • Is there a better way to refresh WebView?

    - by cdg
    Hi all. Ok. I have looked EVERYWHERE and my little brain just can't understand a better way to refresh an activity. Any suggestions that I can understand would be great. :) Here is the java code: package com.dge.dges; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.webkit.WebView; import android.widget.Button; public class dgeActivity extends Activity { WebView mWebView; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mWebView = (WebView) findViewById(R.id.webview); mWebView.getSettings(); mWebView.loadUrl("http://www.websitehere.php"); Button newButton = (Button)findViewById(R.id.new_button); newButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent intent = new Intent(dgeActivity.this, dgeActivity.class); startActivity(intent); } }); } } And here is the main.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/RelativeLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#000000" > <WebView android:id="@+id/webview" android:layout_width="fill_parent" android:layout_height="wrap_content" android:scrollbars="none" /> <Button android:id="@+id/new_button" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:text="Refresh" /> </RelativeLayout> I don't like the idea of just re-stacking activity after activity. There has to be an easier way to refresh the webview. Please help. :)

    Read the article

  • Not able to play videos (from youtube) in WebView

    - by user1205193
    I am using a webview to display a video (could be from youtube or vimeo) in my app. In order to not load the video webpages in the default Android Browser, I am also extending the WebViewClient so I can override the shouldOverrideUrlLoading method. This way the video webpage loads successfully in the WebView. However, when I click on the embedded video on the WebView, it does not play. If I do not override the shouldOverrideUrlLoading method, and let the video webpages load in the default Android browser, the videos work just fine. Any ideas why the videos are not working in the WebView? Also, the main reason why I overrode the shouldOverrideUrlLoading method is because if I do not do that, then when I exit the Android browser to come back to my activity (by hitting the back button on the phone), I see a white screen. Upon hitting the back button twice, I am able to get back to my Activity. I am using the emulator to do this test. Here is my code: public class YoutubeLink extends Activity { WebView myWebView; String video_url; private class HelloWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } } @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.youtubelink); //Retrieving data from ListSample.java Bundle extras = getIntent().getExtras(); if(extras !=null) { video_url = extras.getString("video_url"); Log.d("inside YoutubeLink.java", video_url); } myWebView = (WebView) findViewById(R.id.web); myWebView.getSettings().setJavaScriptEnabled(true); myWebView.setWebViewClient(new HelloWebViewClient()); myWebView.loadUrl(video_url); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if ((keyCode == KeyEvent.KEYCODE_BACK) && myWebView.canGoBack()) { myWebView.goBack(); return true; } return super.onKeyDown(keyCode, event); }}

    Read the article

  • Android WebView not loading a JavaScript file, but Android Browser loads it fine.

    - by Justin
    I'm writing an application which connects to a back office site. The backoffice site contains a whole slew of JavaScript functions, at least 100 times the average site. Unfortunately it does not load them, and causes much of the functionality to not work properly. So I am running a test. I put a page out on my server which loads the FireBugLite javascript text. Its a lot of javascript and perfect to test and see if the Android WebView will load it. The WebView loads nothing, but the browser loads the Firebug Icon. What on earth would make the difference, why can it run in the browser and not in my WebView? Any suggestions. More background information, in order to get the stinking backoffice application available on a Droid (or any other platform except windows) I needed to trick the bakcoffice application to believe what's accessing the website is Internet Explorer. I do this by modifying the WebView User Agent. Also for this application I've slimmed my landing page, so I could give you the source to offer me aid. package ksc.myKMB; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.graphics.Bitmap; import android.os.Bundle; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.Window; import android.webkit.WebChromeClient; import android.webkit.WebView; import android.webkit.WebSettings; import android.webkit.WebViewClient; import android.widget.Toast; public class myKMB extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /** Performs base set up */ /** Create a Activity of this Activity, IE myProcess */ myProcess = this; /*** Create global objects and web browsing objects */ HideDialogOnce = true; webview = new WebView(this) { }; webChromeClient = new WebChromeClient() { public void onProgressChanged(WebView view, int progress) { // Activities and WebViews measure progress with different scales. // The progress meter will automatically disappear when we reach 100% myProcess.setProgress((progress * 100)); //CreateMessage("Progress is : " + progress); } }; webViewClient = new WebViewClient() { public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Toast.makeText(myProcess, MessageBegText + description + MessageEndText, Toast.LENGTH_SHORT).show(); } public void onPageFinished (WebView view, String url) { /** Hide dialog */ try { // loadingDialog.dismiss(); } finally { } //myProcess.setProgress(1000); /** Fon't show the dialog while I'm performing fixes */ //HideDialogOnce = true; view.loadUrl("javascript:document.getElementById('JTRANS011').style.visibility='visible';"); } public void onPageStarted(WebView view, String url, Bitmap favicon) { if (HideDialogOnce == false) { //loadingDialog = ProgressDialog.show(myProcess, "", // "One moment, the page is laoding...", true); } else { //HideDialogOnce = true; } } }; getWindow().requestFeature(Window.FEATURE_PROGRESS); webview.setWebChromeClient(webChromeClient); webview.setWebViewClient(webViewClient); setContentView(webview); /** Load the Keynote Browser Settings */ LoadSettings(); webview.loadUrl(LandingPage); } /** Get Menu */ @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu, menu); return true; } /** an item gets pushed */ @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { // We have only one menu option case R.id.quit: System.exit(0); break; case R.id.back: webview.goBack(); case R.id.refresh: webview.reload(); case R.id.info: //IncludeJavascript(""); } return true; } /** Begin Globals */ public WebView webview; public WebChromeClient webChromeClient; public WebViewClient webViewClient; public ProgressDialog loadingDialog; public Boolean HideDialogOnce; public Activity myProcess; public String OverideUserAgent_IE = "Mozilla/5.0 (Windows; MSIE 6.0; Android 1.6; en-US) AppleWebKit/525.10+ (KHTML, like Gecko) Version/3.0.4 Safari/523.12.2 myKMB/1.0"; public String LandingPage = "http://kscserver.com/main-leap-slim.html"; public String MessageBegText = "Problem making a connection, Details: "; public String MessageEndText = " For Support Call: (xxx) xxx - xxxx."; public void LoadSettings() { webview.getSettings().setUserAgentString(OverideUserAgent_IE); webview.getSettings().setJavaScriptEnabled(true); webview.getSettings().setBuiltInZoomControls(true); webview.getSettings().setSupportZoom(true); } /** Creates a message alert dialog */ public void CreateMessage(String message) { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(message) .setCancelable(true) .setNegativeButton("Close", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alert = builder.create(); alert.show(); } } My Application is running in the background, and as you can see no Firebug in the lower right hand corner. However the browser (the emulator on top) has the same page but shows the firebug. What am I doing wrong? I'm assuming its either not enough memory allocated to the application, process power allocation, or a physical memory thing. I can't tell, all I know is the results are strange. I get the same thing form my android device, the application shows no firebug but the browser shows the firebug.

    Read the article

  • android webView loading finished but it was a blank only I touch the screen can the content show Idont know why?and how it happened

    - by Sunday
    when my webView load this page , it was blank-page or white page only I touch the screen the content can only show private WebView webview; private ProgressDialog mProgressDialog; private Context mContext; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_web); mContext = this; webview = (WebView)findViewById(R.id.myWebView); String url = (String)getIntent().getExtras().get("url"); webview.getSettings().setJavaScriptEnabled(true); webview.setWebViewClient(new MyWebViewClient()); if(url!=null){ webview.loadUrl(url); } } class MyWebViewClient extends WebViewClient { @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { super.onPageStarted(view, url, favicon); mProgressDialog = ProgressDialog.show(mContext, "tips", "wate···the view is loading", true, false); } @Override public void onPageFinished(WebView view, String url) { mProgressDialog.dismiss(); super.onPageFinished(view, url); } }

    Read the article

  • Getting Android SDK WebView and TabWidget to play nice

    - by jdandrea
    I’m taking the HelloTabWidget Android example and trying two things: Moving the tabs to the bottom vs. the top (if that’s even desirable from an Android UI POV) Making each tab show a particular WebView in the space above I’ve got this for a layout (high level): <TabHost> <LinearLayout> <FrameLayout> <WebView/> <WebView/> <WebView/> <WebView/> <WebView/> </FrameLayout> <TabWidget/> </LinearLayout> </TabHost> Everything has a width/height set to fill_parent except for the TabWidget which has its layout_height set to wrap_content (and the layout_gravity set to bottom). First thing I noticed is that WebViews don’t show anything until all the parents have width/height set to fill_parent. However, once I do that, they fill the entire display, obscuring the TabWidget. Is there some other trick to making these two views play nicely together?

    Read the article

  • Calling javascript function from android webview?

    - by Edmond Tamas
    I try to call a javascript function from directly form my application (webview.apk), in order to start a script which would autoplay a html5 video clip, I have tried to add itt right after webview loadURL but wwithout luck. Maybe someone could take a look at the code. What am I missing? Thanks! package tscolari.mobile_sample; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.webkit.WebChromeClient; import android.media.MediaPlayer; public class InfoSpotActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); WebView mainWebView = (WebView) findViewById(R.id.mainWebView); WebSettings webSettings = mainWebView.getSettings(); webSettings.setJavaScriptEnabled(true); mainWebView.setWebChromeClient(new WebChromeClient()); mainWebView.setWebViewClient(new MyCustomWebViewClient()); mainWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); mainWebView.loadUrl("http://server.info-spot.net"); mainWebView.loadUrl("javascript:playVideo()"); } private class MyCustomWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } } }

    Read the article

  • Kindle Fire Cant Fit My Webpage inside a Webview of specific size

    - by Madhavan Rangarao
    This is baffling to me. Please help, I could not figure it out ... In my sample html file I have set the meta tag to be <meta name="viewport" content="target-densitydpi=device-dpi, user-scalable=no"> to fit the webpage inside my webview of custom size say 800x600. In Android, I had to specify "target-densitydpi=device-dpi" and it did the job nicely. I tested my custom web page with nexus 7 tablet and the web page fits inside my web view correctly. The same code does not work in Kindle Fire. Only a part of my web page is shown and even if I set the 'initial-scale=1.0' did not help. I tried various settings programmatically but it did not help either. webview.getSettings().setBuiltInZoomControls(true); webview.getSettings().setSupportZoom(true); webview.getSettings().setLoadWithOverviewMode(true); webview.setInitialScale(1); webview.getSettings().setUseWideViewPort(true); Any pointers?

    Read the article

  • Download File inside WebView

    - by Mayu Mayooresan
    I have a webview in my Android Application. When user goes to webview and click a link to download a file nothing happens. URL = "my url"; mWebView = (WebView) findViewById(R.id.webview); mWebView.setWebViewClient(new HelloWebViewClient()); mWebView.getSettings().setDefaultZoom(ZoomDensity.FAR); mWebView.loadUrl(URL); Log.v("TheURL", URL); How to enable download inside a webview?? If I disable webview and enable the intent to load the url on broswer from application then download works seamlessly. String url = "my url"; Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(url)); startActivity(i); Can someone help me out here. The page loads without issue but the link to a image file in the html page is not working.... Thanks in advance for your time.

    Read the article

  • Passing Data of WebView to Another Activity

    - by meygraph
    I've designed a training program and Html texts and image put into training. I want to address my html file by an activity to sent another activity. This is MainActivity /* * ListView item click listener. So we'll have the do stuff on click of * our ListItem */ listViewArticles.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { switch (position) { case 0: Intent newActivity0 = new Intent(TrickPage.this,a_Dotted_Lines.class); startActivity(newActivity0); break; case 1: Intent newActivity1 = new Intent(TrickPage.this,TutorialsPage.class); startActivity(newActivity1); break; case 2: Intent newActivity2 = new Intent(TrickPage.this,TutorialsPage.class); startActivity(newActivity2); break; case 3: Intent newActivity3 = new Intent(TrickPage.this,TutorialsPage.class); startActivity(newActivity3); break; default: // Nothing do! } and this SecondActivity (show WebView) public class a_Dotted_Lines extends Activity { private WebView webView; @SuppressLint("SetJavaScriptEnabled") @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.a_dotted_lines); // Button HOME ImageButton ImageButton_home = (ImageButton) findViewById(R.id.ImageButton_home); ImageButton_home.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(); intent.setClass(a_Dotted_Lines.this, Main.class); startActivity(intent); overridePendingTransition(R.anim.fadein, R.anim.fadeout); } }); //Button Previous ImageButton ImageButton_previus = (ImageButton) findViewById(R.id.ImageButton_previus); ImageButton_previus.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //Closing SecondScreen Activity finish(); } }); webView = (WebView) findViewById(R.id.webview_compontent); webView.getSettings().setJavaScriptEnabled(true); webView.loadUrl("file:///android_asset/html/article.htm"); } } I want Send "file:///android_asset/html/article.htm" or other addres from MainActivity Is it possible? Sorry My English is not good

    Read the article

  • Add a Contextual Menu to WebView

    - by Woodster
    An easy one, I think: I want to add a contextual menu to a WebView. In IB, I added a NSMenu to the NIB, connected it to the WebView's menu outlet, launched and expected to be able to control-click in the WebView and see the pop-up menu. The only item I saw on the contextual menu is "reload". I can do the same steps but connect the Menu to some other view and it works as expected. Why doesn't the menu work the same when connect to the webview's menu outlet? Thanks

    Read the article

  • How to handle a webview dialog popup?

    - by brockoli
    I'm displaying a webpage in a WebView and on the webpage, there is a button. When you click the button, a confirmation dialog is supposed to popup, but it doesn't show in my WebView. It does popup if I go to the same webpage in the android browser. Anyone know how to handle popup dialogs coming from a webpage inside your WebView? brockoli

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >