我需要从彩信获取图像,有txt和图像。
query.getString(cPart.getColumnIndex("ct"); ...returns text/plain类型。
不显示图像类型。
发布于 2013-07-11 19:30:50
每个MMS消息具有存储在content://mms/part/表中的多个部分。一些部分可以是文本,一些部分可以是图像和其他媒体类型。一旦您有了要读取的彩信ID,请查询所有部件:
Cursor query = getContentResolver().query(Uri.parse("content://mms/part", null, "mid = " + mmsID, null, null);如果彩信包含和图像,则它将有一个内容类型为图像类型的部分。
if(query.moveToFirst()) {
do {
String type = query.getString(query.getColumnIndex("ct"));
if(type.equals("image/bmp") || type.equals("image/jpeg") || ...)
//Read the image
while(query.moveToNext());
}有关阅读彩信的更多信息,请查看here。
https://stackoverflow.com/questions/17591081
复制相似问题