Hello. I ask for help. I could not figure it out myself. I decided to play around with SMS in android- pull them out, do something to take off, etc. Pull it out - that's all. I don’t understand how to do the sorting, for example, if we press a button to search for a specific text in a message, and then output these messages.
public class MessageBox extends Activity { // GUI Widget Button start; TextView lblMsg, lblNo; ListView lvMsg; String number; // Cursor Adapter SimpleCursorAdapter adapter; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.messagebox); start = (Button)findViewById(R.id.start); lvMsg = (ListView) findViewById(R.id.lvMsg); Uri inboxURI = Uri.parse("content://sms/inbox"); String[] reqCols = new String[]{"_id", "address", "body"}; ContentResolver cr = getContentResolver(); Cursor c = cr.query(inboxURI, reqCols, null, null, null); adapter = new SimpleCursorAdapter(this, R.layout.row, c, new String[]{"body", "address"}, new int[]{ R.id.lblMsg, R.id.lblNumber}); lvMsg.setAdapter(adapter); start.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { } }); } }