/**将发送的短信插入数据库**/  
        ContentValues values = new ContentValues();  
        //发送时间   
        values.put("date", System.currentTimeMillis());  
        //阅读状态   0未读,1已读
        values.put("read", 0);  
        //1为收 2为发   
        values.put("type", 1);  
        //送达号码   
        values.put("address", num);  
        //送达内容   
        values.put("body", text);  
        //插入短信库   
        context.getContentResolver().insert(Uri.parse("content://sms"),values); 在系统短信数据库里插入一条短信如何像新收到短信一样的有推送呢?

解决方案 »

  1.   

    好吧,自己写了个仿系统短信的推送,不完美 private void notification() { NotificationManager nm = (NotificationManager) context
    .getSystemService(Context.NOTIFICATION_SERVICE); Notification n = new Notification(); // 设置显示在手机最上边的状态栏的图标
    n.icon = R.drawable.stat_notify_sms;
    // 当当前的notification被放到状态栏上的时候,提示内容
    n.tickerText = num + ":" + text;
    n.flags = Notification.FLAG_AUTO_CANCEL; Intent i = new Intent();
                    //直接启动系统短信
    i.setComponent(new ComponentName("com.android.mms",
    "com.android.mms.ui.ConversationList"));
    i.setAction(Intent.ACTION_VIEW); PendingIntent p = PendingIntent.getActivity(context, 0, i,
    PendingIntent.FLAG_ONE_SHOT);
    n.setLatestEventInfo(context, num, text, p);
    nm.notify(1, n); }