Joke Collection Website - Public benefit messages - How to realize short message quick query in android system? (code)
How to realize short message quick query in android system? (code)
Public static cursor query All (Context)
{
//Cursor cur = context . getcontentresolver()。 Query (content _URI, projection,
//"Length (fragment) > 0", null, null);
cursor cur = context . getcontentresolver()。 query(Uri.parse("content://sms "),
New string [] {"Thread id, date, address, read, status, type, body, count (address) is"
+ "totleCount,_id from (select thread_id,_id,substr(address,4) as address,date,read,status,type,body "
+"from sms, where the address such as \"+86%\ "and the length (thread_id)>0 jointly select thread id, _id, address, date, reading, status, type and text."
+"from SMS where length (thread _ id) > 0 and address are different \"+86% \ ") r group by R. thread _ id order by R. datedesc-"},
Empty,
Empty,
null);
Return to cur
}
Get all the contents of the session.
Public static void asyncqueryall (asyncqueryhandler handler, int tag, string thread_id)
{
handler . cancel operation(token);
ThreadID = thread _ id
Handler.startQuery(token, null, SMS _ URI _ all, PROJECTION, sql, new String[]{thread_id}, "date desc");
}
- Previous article:Funny SMS avatars are free.
- Next article:If vaccinated, please ignore how to operate.
- Related articles
- Bank of Suzhou interviewed and asked why.
- How to inform the middle class to start writing?
- What is the font type of Steins;Gate?
- How can a girl send a text message when she cries?
- 65438+Latest reminder of Handan CDC on February 30th 65438+Latest reminder of Handan CDC on February 30th.
- Why can't Xiaomi mix2 answer the phone or make a phone call?
- How to send short messages to traffic packets?
- Does it cost money to buy email?
- Blessings from teachers on June 1st
- How to make the electronic transfer voucher of China Construction Bank?