本文整理汇总了Java中android.telephony.SmsMessage.isStatusReportMessage方法的典型用法代码示例。如果您正苦于以下问题:Java SmsMessage.isStatusReportMessage方法的具体用法?Java SmsMessage.isStatusReportMessage怎么用?Java SmsMessage.isStatusReportMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.telephony.SmsMessage
的用法示例。
在下文中一共展示了SmsMessage.isStatusReportMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateMessageStatus
import android.telephony.SmsMessage; //导入方法依赖的package包/类
private SmsMessage updateMessageStatus(Context context, Uri messageUri, byte[] pdu,
String format) {
SmsMessage message = SmsMessage.createFromPdu(pdu);
if (message == null) {
return null;
}
// Create a "status/#" URL and use it to update the
// message's status in the database.
Cursor cursor = SqliteWrapper.query(context, context.getContentResolver(),
messageUri, ID_PROJECTION, null, null, null);
try {
if (cursor.moveToFirst()) {
int messageId = cursor.getInt(0);
Uri updateUri = ContentUris.withAppendedId(STATUS_URI, messageId);
int status = message.getStatus();
boolean isStatusReport = message.isStatusReportMessage();
ContentValues contentValues = new ContentValues(2);
log("updateMessageStatus: msgUrl=" + messageUri + ", status=" + status +
", isStatusReport=" + isStatusReport);
contentValues.put("status", status);
contentValues.put("date_sent", System.currentTimeMillis());
SqliteWrapper.update(context, context.getContentResolver(),
updateUri, contentValues, null, null);
} else {
error("Can't find message for status update: " + messageUri);
}
} finally {
cursor.close();
}
return message;
}
示例2: updateMessageStatus
import android.telephony.SmsMessage; //导入方法依赖的package包/类
private SmsMessage updateMessageStatus(Context context, Uri messageUri, byte[] pdu,
String format) {
SmsMessage message = SmsMessage.createFromPdu(pdu, format);
if (message == null) {
return null;
}
// Create a "status/#" URL and use it to update the
// message's status in the database.
Cursor cursor = SqliteWrapper.query(context, context.getContentResolver(),
messageUri, ID_PROJECTION, null, null, null);
try {
if (cursor.moveToFirst()) {
int messageId = cursor.getInt(0);
Uri updateUri = ContentUris.withAppendedId(STATUS_URI, messageId);
int status = message.getStatus();
boolean isStatusReport = message.isStatusReportMessage();
ContentValues contentValues = new ContentValues(2);
if (Log.isLoggable(LogTag.TAG, Log.DEBUG)) {
log("updateMessageStatus: msgUrl=" + messageUri + ", status=" + status +
", isStatusReport=" + isStatusReport);
}
contentValues.put(Sms.STATUS, status);
contentValues.put(Inbox.DATE_SENT, System.currentTimeMillis());
SqliteWrapper.update(context, context.getContentResolver(),
updateUri, contentValues, null, null);
} else {
error("Can't find message for status update: " + messageUri);
}
} finally {
cursor.close();
}
return message;
}