我有一个谷歌日历,我试图在我的Android应用程序中显示,但是当我这样做时,它会被我的HTC Incredible 2切断。它在我的Nexus 7上显示正常。我已尝试使用答案发现here但仍然没有运气。任何帮助都会 awesome 。谢谢!
public class Events extends SherlockActivity
{
boolean isLoaded = false;
ActionBar actionBar;
WebView eventView;
ProgressDialog progressDialog;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.events);
actionBar = getSupportActionBar();
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayShowHomeEnabled(false);
eventView = (WebView) findViewById(R.id.eventsView);
eventView.getSettings().setJavaScriptEnabled(true);
final Activity activity = this;
/* Cut out loading screen, etc */
eventView.loadUrl("https://www.google.com/calendar/embed?showTitle=0&mode=MONTH&height=600&wkst=1&bgcolor=%23ffffff&src=fresnochaffeezoo%40gmail.com&color=%23182C57&ctz=America%2FLos_Angeles");
}
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<WebView
android:id="@+id/eventsView"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</RelativeLayout>
答案 0 :(得分:0)
以下设置有助于最初呈现页面的方式:
eventView.getSettings().setUseWideViewPort( false );
eventView.getSettings().setLoadWithOverviewMode( true );
任选:
eventView.getSettings().setDefaultZoom( ZoomLevel. ... );