短信通知

时间:2014-06-18 18:15:56

标签: android android-notifications

我正在制作一个虚假的短信应用程序。创建了假短信,但没有收到通知 请指导我从设备短信应用程序获取原始通知 这是我的代码:

        ContentValues values = new ContentValues();
        values.put("address", phoneNumber);
        values.put("body", message);
        values.put("date",  String.valueOf(startTime));
        getContentResolver().insert(Uri.parse("content://sms/inbox"), values);

1 个答案:

答案 0 :(得分:0)

有很多"设备短信应用"。他们是否显示通知取决于他们。

许多人会根据通过短信广播收到短信这样做。并且,希望大多数require that the sender of this broadcast be the system,以防止恶意软件作者发送恶搞广播。

而且,您的代码无论如何都无法在Android 4.4+上运行,如you can no longer write to the SMS ContentProvider unless you are the user's default SMS client