content provider

    [Kotlin] ContentResolver 기본 : 통화내역(Call log) 조회

    [Kotlin] ContentResolver 기본 : 통화내역(Call log) 조회

    1ContentResolver란? ContentProvider가 uri로 접근경로를 열어 제공하는 데이터들을 조회하는 Query입니다.쉽게 생각해서 content uri에 db가 존재하고, 그걸 조회하는 qeury를 작성해 contentResolver로 실행한다고 볼 수 있습니다. val resolver: ContentResolver = this.contentResolver val callLogUri = CallLog.Calls.CONTENT_URI var cursor: Cursor? try{ cursor = resolver.query(callLogUri, null, null, null, null) if (cursor != null) { var maxcount = 2 while (cursor.moveTo..