I need to open the calendar app on my Android Device using a simple html link. I was able to do this in iOS with href=CALSHOW:// is there something similar for android?
I don't know to be such link that WebView would support, but it's very easy to handle that link for yourself. I am assuming you're loading the web content (html) in a WebView. Inside the html you will have this type of link:
Open calendar
In the Java code, you will overwrite that link:
myWebView.setWebViewClient(new WebViewClient(){
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if(url.startsWith("CALSHOW")) {
openCalendar();
return true;
}
return super.shouldOverrideUrlLoading(view, url);
}
});
And the method to open the calendar:
protected void openCalendar() {
Intent calendarIntent = new Intent() ;
/**
* Set the time you need ...
* */
//calendarIntent.putExtra("beginTime", your_time);
calendarIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_SINGLE_TOP);
calendarIntent.setClassName("com.android.calendar","com.android.calendar.AgendaActivity");
startActivity(calendarIntent);
}
That is the work-around