2011-09-07 7 views

답변

2

가 보낸 MSG 가져올 수 있습니다 : 당신이 PIN이하는 카운터를 사용할 수

Uri mSmsinboxQueryUri = Uri.parse("content://sms/sent"); 
    Cursor cursor1 = getContentResolver().query(mSmsinboxQueryUri, 
       new String[] { "_id", "thread_id", "address", "person", "date", 
           "body", "type" }, null, null, null); 
    startManagingCursor(cursor1); 
    String[] columns = new String[] { "address", "person", "date", "body","type" }; 
    if (cursor1.getCount() > 0) { 
     String count = Integer.toString(cursor1.getCount()); 
     Log.e("Count",count); 
     while (cursor1.moveToNext()){ 
      String address = cursor1.getString(cursor1.getColumnIndex(columns[0])); 
      String name = cursor1.getString(cursor1.getColumnIndex(columns[1])); 
      String date = cursor1.getString(cursor1.getColumnIndex(columns[2])); 
      String msg = cursor1.getString(cursor1.getColumnIndex(columns[3])); 
      String type = cursor1.getString(cursor1.getColumnIndex(columns[4])); 
     } 
    } 

최근 SMS를 보냈다.

는 다른 유용한 링크를 참조하십시오 :

Android: Is there any way to listen outgoing sms?

Listen outgoing SMS or sent box in Android

How to listen/subscribe to Outgoing SMS notifications?

+0

<receiver android:name="SmsReceiver"> <intent-filter> <action android:name= "android.provider.Telephony.SMS_RECEIVED" /> </intent-filter> </receiver> 

코드 매니페스트

에서

사용이 : // SMS/보냈습니다 나 있지만, 내용 작동하지 않습니다 : // SMS/않습니다. 왜 이것이 사실이라고 생각하니? – gonzobrains

-2

사용하는 서비스입니다. braodcastreceiver를 통해 SMS를 보낼 때 메시지를받는 서비스로 청취자를 등록하십시오. 어떤 이유로 콘텐츠를 smsreceiver

public class SmsReceiver extends BroadcastReceiver 

{ 

    @Override 

    public void onReceive(Context context, Intent intent) 

    { 

     //here your code 



    } 



} 
+1

* 수신 * 텍스트 메시지에서 작동하지만 OP에서 * 보내는 * 텍스트를 묻습니다. 현재 보내는 텍스트를 수신 할 방송이 없습니다. – Jag

관련 문제