[英]How to add iframe into an activity using android studio (I want to add google calender from a website)
This is my iframe code : 这是我的iframe代码:
<iframe src="https://www.google.com/calendar/embed?mode=WEEK&height=600&wkst=7&bgcolor=%23FFFFFF&src=diit.info_m7f27lakenu0t49fbe2aojn9rg@group.calendar.google.com&color=%23865A5A&ctz=Asia%2FDhaka" style=" border-width:0 " width="750" height="440" frameborder="0" scrolling="no"></iframe>`
Now I want to show this google calendar into my activity. 现在,我想将此Google日历显示到我的活动中。 Please let me know how can i do that.
请让我知道我该怎么做。
Using WebVew I guess...? 我猜使用WebVew ...? Or are you encountering any problems using it?
还是您在使用它时遇到任何问题?
İf you want to show google calendar in your app. 如果您想在您的应用程序中显示Google日历。 You have to use google calendar api.
您必须使用Google Calendar API。 Here is the step by step education in google developers.
这是Google开发人员的分步教学。
İf you want to show a web site in your app,you can use WebView. 如果要在您的应用程序中显示网站,则可以使用WebView。
enter code public class WebViewActivity extends AppCompatActivity {
private WebView mWebView;
private static final String urlTag = "url";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
Intent intent = getIntent();
String postUrl = intent.getStringExtra(urlTag);
String title=intent.getStringExtra("title");
mWebView = new WebView(this);
mWebView.getSettings().setJavaScriptEnabled(true);
final Activity activity = this;
mWebView.setWebViewClient(new WebViewClient() {
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
Toast.makeText(activity, description, Toast.LENGTH_SHORT).show();
}
});
mWebView.loadUrl(postUrl);
// setContentView(mWebView);
// TODO:YUKLEME PROGRESS DENE
mWebView.setWebViewClient(new WebViewClient() {
ProgressDialog progressDialog = new ProgressDialog(WebViewActivity.this);
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
Log.e("I am loading Here ", "Start");
progressDialog.setTitle("Loading");
progressDialog.setMessage("Please wait....");
progressDialog.show();
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Log.e("I am loading Here ", "Override");
view.loadUrl(url);
return true;
}
@Override
public void onPageFinished(WebView view, String url) {
progressDialog.dismiss();
}
});
setContentView(mWebView);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.