0
私は コールを受信しなかったときにメッセージを送信するアプリを開発したいと思っています。しかし、SMSを以前に送信したときに問題が発生しました この問題を解決するため、私は小さなアイデアに時間 試し{不在着信のSMSを送信
cursor = getContentResolver().query(
Uri.parse("content://call_log/calls"),
projection,
selection,
selectionArgs,
sortOrder);
// cursor.getString(cursor.getColumnIndex(android.provider.CallLog.Calls.MISSED_TYPE));
while (cursor.moveToNext()) {
String callLogID = cursor.getString(cursor.getColumnIndex(android.provider.CallLog.Calls._ID));
String callNumber = cursor.getString(cursor.getColumnIndex(android.provider.CallLog.Calls.NUMBER));
String callDate = cursor.getString(cursor.getColumnIndex(android.provider.CallLog.Calls.DATE));
String callType = cursor.getString(cursor.getColumnIndex(android.provider.CallLog.Calls.TYPE));
String isCallNew = cursor.getString(cursor.getColumnIndex(android.provider.CallLog.Calls.NEW));
//String missedcall= cursor.getString(cursor.getColumnIndex(android.provider.CallLog.Calls.MISSED_TYPE));
/*if(Integer.parseInt(callType) == android.provider.CallLog.Calls.MISSED_TYPE && Integer.parseInt(isCallNew) > 0){
tv.append("hai");
//if (_debug) Log.v("Missed Call Found: " + callNumber);
}*/
if(cursor.getString(cursor.getColumnIndexOrThrow(android.provider.CallLog.Calls.TYPE)).equalsIgnoreCase("3") && Integer.parseInt(isCallNew)>0)
{
tv.append("ok"+callNumber+"\n");
sm.sendTextMessage(callNumber, null, " iam in work i will call you later", null, null);
}
}
}catch(Exception ex){
//if (_debug) Log.e("ERROR: " + ex.toString());