0

Android 用のアプリケーションを開発しようとしています。電話のカレンダーに保存されているすべてのカレンダー エントリ (リマインダー) を取得する必要があります。どうすれば取得できますか? そして、Androidエミュレーターでそれを行うことはできますか??

4

2 に答える 2

0

GData は非推奨であり、多くの Android バージョンと互換性がありません。

これを読むと役に立ちます。

于 2012-01-17T17:54:45.593 に答える
-1

私はこのコードを手に入れました.ほら、それはあなたを助けるかもしれません

Cursor cursor = cr.query(Uri.parse("content://calendar/events"), new String[]{ "calendar_id", "title", "description", "dtstart", "dtend", "eventLocation" }, null, null, null);         
    //Cursor cursor = cr.query(Uri.parse("content://calendar/calendars"), new String[]{ "_id", "name" }, null, null, null);
    String add = null;
    cursor.moveToFirst();
    String[] CalNames = new String[cursor.getCount()];
    int[] CalIds = new int[cursor.getCount()];
    for (int i = 0; i < CalNames.length; i++) {
        CalIds[i] = cursor.getInt(0);
        CalNames[i] = "Event"+cursor.getInt(0)+": \nTitle: "+ cursor.getString(1)+"\nDescription: "+cursor.getString(2)+"\nStart Date: "+new Date(cursor.getLong(3))+"\nEnd Date : "+new Date(cursor.getLong(4))+"\nLocation : "+cursor.getString(5);
        if(add == null)
            add = CalNames[i];
        else{
            add += CalNames[i];
        }           
        ((TextView)findViewById(R.id.calendars)).setText(add);

        cursor.moveToNext();
    }
    cursor.close();
于 2011-08-09T10:43:20.157 に答える