Move message to inbox from database

Can I move a message from an application to inbox?

I created an application that will catch a message before logging in and make a new message record in the database.

But after that, I want to give the user the ability to "move to the inbox / save to the inbox to a specific selected message.

Can this be done? How?

Any suggestion would be appreciated.

Thanks in advance.

+4
source share
2 answers

Have you tried using this code below?

For content: // sms / inbox, fields _id, thread_id, address, identity, date, protocol, reading, status, type, reply_path_present, subject, body, service_center, blocked .

ContentValues values; values.put("date",mDate); values.put("address",mPhoneNumber); values.put("body",mMessage); ... // put values for various fields context.getContentResolver().insert(Uri.parse("content://sms/inbox"),values); 

I don’t have time to try it right now, but it should work logically. Let me know if this is not so!

+4
source

My idea sets the status of your message, for example 1, 2 = incoming, 3 = draft.

So, if you want to move to the inbox, just change / update its status to 2. Something like this.

0
source

Source: https://habr.com/ru/post/1395544/


All Articles