I am working in a project in android, this app needs to receives a sms from a specifict phone number to launch another app. I already attained to get the message tray, but I do not know how use a filter to be able to get the sms from that specifict phone number in order to launch (activate) the app.
Here is the code from where I am getting the full sms list:
ArrayList smsList = new ArrayList();
public void onItemClick(AdapterView<?> parent, View view, int pos, long id) { try { String[] splitted = smsList.get(pos).split("\n"); String sender = splitted[0]; String encryptedData = ""; for (int i = 1; i < splitted.length; ++i) { encryptedData += splitted[i]; } String data = sender + "\n" + StringCryptor.decrypt(new String(SmsReceiver.PASSWORD), encryptedData); Toast.makeText(this, data, Toast.LENGTH_SHORT).show(); } catch (Exception e) { e.printStackTrace(); } }