0

私は助けが必要です。Android の私のアプリは、webview に Facebook の投稿を表示しません。ボックスのURLのように使用します。

コード:

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        WebView wv = (WebView)findViewById(R.id.content);
        wv.setWebViewClient(new WebViewClient(){
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                //view.loadUrl(url);
                return super.shouldOverrideUrlLoading(view, url);
            }
        });
        wv.loadUrl("http://www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FFacebookDevelopers%2F137639306301187&show_faces=true&colorscheme=light&stream=true&show_border=false&header=false&width=480&height=800");
    }

助けてください。どうも

4

1 に答える 1

0
//Facebook use javascript to show feeds you have to enable javascript in your code. Try this.   
 @Override 
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            WebView wv = (WebView)findViewById(R.id.webView1);
            WebSettings webSettings = wv.getSettings();
            webSettings.setJavaScriptEnabled(true);
            webSettings.setUseWideViewPort(true);
            webSettings.setLoadWithOverviewMode(true);
            wv.setWebViewClient(new WebViewClient(){
               @Override
               public boolean shouldOverrideUrlLoading(WebView view, String url) {
                   //view.loadUrl(url);
                   return super.shouldOverrideUrlLoading(view, url);
               }
           });
           wv.loadUrl("your URL");

           wv.getSettings().setUseWideViewPort(true);

        }
于 2013-09-26T14:11:28.083 に答える