I'm trying to create a WebView app that shows a meteor web app using Tiago Scolari's sample.

When i load the apk in my phone i see the background changes but the log in button doesn't show.

Anyone has a clue how to make this work?

--Edit:

Adding -

webSettings.setJavaScriptCanOpenWindowsAutomatically(true);

webSettings.setDomStorageEnabled(true);

- shows me the log in button and gets me to the facebook log in.

After logging in using facebook i'm presented with a white screen.

Any more advice?

Some code:

main.xml (layout):

android:orientation="vertical"

android:layout_width="fill_parent"

android:layout_height="fill_parent">

android:layout_height="match_parent"

android:id="@+id/mainWebView">

AndroidMobileAppSample.java (java wrapper):

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;

public class AndroidMobileAppSampleActivity 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);

webSettings.setJavaScriptCanOpenWindowsAutomatically(true);

webSettings.setDomStorageEnabled(true);

mainWebView.setWebViewClient(new MyCustomWebViewClient());

mainWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);

mainWebView.loadUrl("http://pastime.meteor.com/");

}

private class MyCustomWebViewClient extends WebViewClient {

@Override

public boolean shouldOverrideUrlLoading(WebView view, String url) {

view.loadUrl(url);

return false;

}

}

}

解决方案

oke I just tested it on my 2.3.4 android and yea there is no facebooklogin. Its a WebView problem. Changed the code and still the login dosent appear...

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐