public void readSMS() {
System.out.println("Inside of SMS Reading.......");
Uri SMSURI = Uri.parse("content://sms/inbox");
String[] projection = new String[] { "_id", "address", "body", "date" };
Cursor cursor = null;
try {
System.out.println("Inside of SMS Reading Try.......");
cursor = getContentResolver().query(SMSURI, projection, null // selection
, null // selectionArgs
, null); // sortOrder
if (cursor != null && cursor.moveToFirst()) {
do {
// System.out.println("Inside of SMS Reading DO.......");
int id = cursor.getInt(cursor.getColumnIndex("_id"));
String address = cursor.getString(cursor
.getColumnIndex("address"));
String body = cursor.getString(cursor
.getColumnIndex("body"));
String date = cursor.getString(cursor
.getColumnIndex("date"));
SMSNo.add(address);
SMSText.add(body);
SMSType.add("Incoming");
SMSTime.add(getSMSTime(Long.parseLong(date)));
} while (cursor.moveToNext());
// readOutgoingSMS();
}
} catch (Exception e) {
System.out.println("Error = " + e.toString());
} finally {
if (cursor != null) {
cursor.close();
}
}
}
我正在开发一个应用程序,用户可以在其中将他们的消息上传到服务器,并可以随时下载它们。但是我收到了一个非常奇怪的错误。每当我在默认消息中收到一条消息时,它都会向我显示 2 条消息,其中一条是加密的。它还向我展示了我的应用程序已停止工作的祝酒词。谁能告诉我为什么会这样?