0

このリンクのGoogleカレンダーAPIチュートリアルに続いて、Googleカレンダーからデータを取得できましたhttps://developers.google.com/google-apps/calendar/quickstart/android。アンドロイドスタジオのGoogleカレンダーから取得したデータを編集するにはどうすればよいですか?アンドロイドスタジオのGoogleカレンダーから取得したデータを編集するにはどうすればよいですか?

+0

あなたがこれまで書いてきたコードを投稿してくださいことはできますか? –

+0

私は更新のコードがありません。 – ACE

+0

カレンダーで取得した予定を更新する場合は、[[Events:update'](https://developers.google.com/google-apps/calendar/v3/reference/events/)を確認してください。更新)をお手伝いできる場合は、これを使用すると、カレンダー内のイベントのメタデータを更新または変更できます。 JAVAを使用してカレンダーでイベントを更新する方法については、この[example](https://developers.google.com/google-apps/calendar/v3/reference/events/update#examples)をご確認ください。 – KENdi

答えて

0

これはイベントを追加するコードです。

import android.content.Intent; 
import android.provider.CalendarContract; 
import android.support.v7.app.ActionBarActivity; 
import android.os.Bundle; 
import android.view.View; 
import java.util.Calendar; 
import android.provider.CalendarContract.Events; 

public class MainActivity extends ActionBarActivity { 

@Override 
protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.activity_main); 
} 

public void onAddEventClicked(View view){ 
    Intent intent = new Intent(Intent.ACTION_INSERT); 
    intent.setType("vnd.android.cursor.item/event"); 

    Calendar cal = Calendar.getInstance(); 
    long startTime = cal.getTimeInMillis(); 
    long endTime = cal.getTimeInMillis() + 60 * 60 * 1000; 

    intent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, startTime); 
    intent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME,endTime); 
    intent.putExtra(CalendarContract.EXTRA_EVENT_ALL_DAY, true); 

    intent.putExtra(Events.TITLE, "Create Event"); 
    intent.putExtra(Events.DESCRIPTION, "description"); 
    intent.putExtra(Events.EVENT_LOCATION, "My Guest House"); 
    intent.putExtra(Events.RRULE, "FREQ=YEARLY"); 

    startActivity(intent); 
} 

}

+0

このコードは、回答ではなく質問の一部として貼り付ける必要があります – KENdi

関連する問題