Em terça-feira, 28 de julho de 2015 19:16:19 UTC-3, Marcelo H escreveu:
Por padrão javascript é desabilitado na webview.
http://developer.android.com/guide/webapps/webview.htmlEnabling JavaScript
JavaScript is disabled in a
WebViewby default. You can enable it through theWebSettingsattached to yourWebView. You can retrieveWebSettingswithgetSettings(), then enable JavaScript withsetJavaScriptEnabled().For example:
WebView myWebView = (WebView) findViewById(R.id.webview);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
WebSettingsprovides access to a variety of other settings that you might find useful. For example, if you're developing a web application that's designed specifically for theWebViewin your Android application, then you can define a custom user agent string withsetUserAgentString(), then query the custom user agent in your web page to verify that the client requesting your web page is actually your Android application.Em 28 de julho de 2015 18:57, Pedro horlando <xva...@gmail.com> escreveu:--Olá amigos tudo bem!Bom gostaria da ajuda de você para resolver um problema com um webview que estou fazendo onde o site tem vários videos e de play de diferentes site, porem o sempre pede para ativar javascript como mostra na foto abaixo ate a parte do flash já resolve mas esse javascript ta osso.
Meu arquivo MainActivity esta assim:
import android.app.Activity;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.FrameLayout;
import android.widget.ProgressBar;
import android.graphics.Bitmap;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final ProgressBar pb = new ProgressBar(this);
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lp.gravity = Gravity.CENTER;
pb.setLayoutParams(lp);
final FrameLayout fl = (FrameLayout) findViewById(R.id.frameLayout);
final WebView wv = (WebView) findViewById(R.id.webView);
wv.loadUrl("http://www.meusite.com.br");
wv.setWebViewClient(new WebViewClient(){
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon){
/*ProgressBar pb = (ProgressBar) findViewById(R.id.progress);
pb.setVisibility(View.VISIBLE);*/
fl.addView(pb);
}
@Override
public void onPageFinished(WebView view, String url){
//ProgressBar pb = (ProgressBar) findViewById(R.id.progress);
//pb.setVisibility(View.INVISIBLE);
fl.removeView(pb);
wv.setVisibility(View.VISIBLE);
}
});
}
}
Obrigado a todos
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--- Marcelo Henrique -"Se não puder se destacar pelo talento, vença pelo esforço." (Dave Weinbaum)."Mate o pecado antes que ele o mate." ( Richard Baxter ).
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.






0 comentários:
Postar um comentário