Add a calendar event using a webpage button via webview
<p>I want to use a webview to pull up a page and on it is a label of an event and a button that says add to calendar. When pushed it will add the details of the event to the google cal on the android phone. </p>

<p>I am attempting to use content values but with no luck as of yet. This is what I have but I am open for suggestions.  I think I have read every post on stackoverflow concerning this so I am looking for something new or more complete than whats been posted already. </p>

<pre><code>public class button7 extends Activity{

 WebView wb = null;

 /** Called when the activity is first created. */
 @Override
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.buttons);
  wb = new WebView(this);
  wb.setWebViewClient(new HelloWebViewClient());
  wb.getSettings().setJavaScriptEnabled(true);
  wb.loadUrl("http://whatever website.com");
  setContentView(wb);
 }

 private class HelloWebViewClient extends WebViewClient {

  public boolean shouldOverrideUrlLoading(WebView view, String url) {
   view.loadUrl(url);
   SetCalenderEntry(1,"Test","Is this working","At home");
   return true;
  }

 }




 private void SetCalenderEntry(int i,  String subject, String body, String location) 
 {
    ContentValues event = new ContentValues();
    event.put("calendar_id", i);
    event.put("title", subject);
    event.put("description", body);
    event.put("eventLocation", location);
    long startTime = System.currentTimeMillis() + 1000 * 60 * 60;
    long endTime = System.currentTimeMillis() + 1000 * 60 * 60 * 2;
    event.put("dtstart", startTime);
    event.put("dtend", endTime);
    Uri eventsUri = Uri.parse("content://calendar/events");
    getContentResolver().insert(eventsUri, event);
 }

 public boolean onKeyDown(int keyCode, KeyEvent event) {
  if (keyCode == KeyEvent.KEYCODE_BACK &amp;&amp; wb.canGoBack())
   wb.goBack();
  return super.onKeyDown(keyCode, event);
 }
}
</code></pre>
