보이지 않는 SMS 메시지의 경우 content : // sms에 메시지가 있는지 확인하기 위해 확인할 수있는 열이 있습니다. 열 이름이 "표시됨"입니다.
IT 및 검사를 호출
예 :
ContentResolver mContectResolver = context.getContentResolver();
Uri uri = Uri.parse("content://sms/");
String[] mProjection = {
"_id",
"address",
"person",
"date",
"body",
"protocol",
"seen"
};
Cursor cursor = mContectResolver.query(uri, mProjection, null, null, null);
cursor.moveToFirst();
for(int i = 0 ; i<cursor.getCount() ; i++){
if(cursor.getString(cursor.getColumnIndexOrThrow("seen")).equalsIgnoreCase("1")){
//Message has not been seen
}
cursor.moveToNext();
}
cursor.close();
I 라인 1의 상황으로 무슨 정의해야합니까? – mohammad
컨텍스트 context = getApplicationContext(); 이 메서드를 호출하는 것은 Activity에서 얻은 컨텍스트입니다. –