我想在android中使用getContentResolver()檢索通話記錄。android通話記錄ContentResolver
我收到以下錯誤
Cannot make a static reference to the non-static method getContentResolver() from the type ContextWrapper
能否請您解釋一下我的this.I我剛剛啓動,與Android和Java。
public static void GetCalls() {
String[] CallDetails = {
android.provider.CallLog.Calls._ID,
android.provider.CallLog.Calls.CACHED_NAME,
android.provider.CallLog.Calls.NUMBER,
android.provider.CallLog.Calls.DATE,
android.provider.CallLog.Calls.DURATION,
};
Cursor cursor;
cursor = getContentResolver().query(CallLog.CONTENT_URI, CallDetails, null, null,null);
}
從方法中刪除靜態關鍵字 – SilentKiller 2014-09-20 09:35:12