我创建了彩信。问题是:这显示在我的应用程序中,但未显示在 android 本机消息应用程序中。你知道什么是错的吗?我应该为 thread_id 设置什么?提前致谢。
---这是我的代码---
ContentResolver cr = getContentResolver();
ContentValues cv = new ContentValues();
cv.put("thread_id", System.currentTimeMillis() % 100);
cv.put("ct_t", "application/vnd.wap.multipart.related");
cv.put("read", "1");
Uri temp_mms = cr.insert(Uri.parse("content://mms/inbox"), cv);
String str_uri = temp_mms.toString();
String newID = temp_mms.getLastPathSegment().trim();
ContentValues cv_addr2 = new ContentValues();
cv_addr2.put("address", "112233");
Uri temp_mms_addr2 = cr.insert(Uri.parse("content://mms/"+ newID +"/addr"), cv_addr2);
// ------------------------------PART Table ContentValues
Uri uriPart = Uri.parse("content://mms/"+ newID +"/part");
ContentValues cv_part2 = new ContentValues();
cv_part2.put("ct", "image/jpeg");
Uri temp_mms_part2 = cr.insert(uriPart, cv_part2);
OutputStream os = cr.openOutputStream(temp_mms_part2);
InputStream is = cr.openInputStream(selectedImageUri);
byte[] buffer = new byte[256];
for (int len = 0; (len = is.read(buffer)) != -1; ) {
os.write(buffer, 0, len);
}