How to get MMS id Android Application

妖精的绣舞 提交于 2021-02-07 15:40:42

问题


can anyone help me out to find MMS id, i using this code to get MMS text but i don't know the MMS id (mmsId) so i stopped !!

I'll be thankful for your help

Samila


回答1:


Uri mmsInboxUri = Uri.parse("content://mms");               
Cursor mmsInboxCursor = getContentResolver().query(mmsInboxUri ,new String[]     
    {"_id","msg_box","ct_t","date"}, "msg_box=1 or msg_box=2", null, null);
int count = mmsInboxCursor.getCount(); 
if(mmsInboxCursor != null){

    try{

         if (mmsInboxCursor.moveToFirst())
         {                  
            do{

                System.out.println("<====MONITORING MESSAGES====>");                                
                int id = mmsInboxCursor.getString(0); 
              }while(mmsInboxCursor.moveToNext());
        }
    }catch (Exception e) {

        System.out.println("MMSMonitor :: startMMSMonitoring Exception== "+ e.getMessage());
    }
}


来源:https://stackoverflow.com/questions/10065249/how-to-get-mms-id-android-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!