我正在開發一個與消息相關的應用程序。如何在我的應用程序中知道我何時發送新消息?
在我的應用程序中,我使用contentresolver獲取所有發送的消息。
代碼
c = getContentResolver().query(SMS_sent,null, null, null, null);
startManagingCursor(c);
if(c!=null)
{
((LinearLayout)findViewById(R.id.linearLayout11)).setVisibility(View.GONE);
String columns ="body";
String columns1 = "address";
SimpleCursorAdapter adapter2 = new SimpleCursorAdapter(this, R.layout.main2,c,
new String[] {columns1,columns}, new int[]{R.id.textView2, R.id.textView4});
ListView empListView = (ListView)findViewById(R.id.listView1);
empListView.setAdapter(adapter2);
}
它工作正常。
我的要求是,當我發送新郵件,
我想hanlde,在我的應用程序。
如果任何人知道解決的辦法,請大家幫我
在此先感謝
卜使用brodcast resevers U將得到的信息接收華南簡介我sms.but想知道發來的短信。 – kiran
對不起,我錯過了。因爲我知道這是沒有辦法的。如果你製作了一個控制短信的應用程序。活動選擇器會提示用戶使用哪個應用程序。並且用戶選擇你的應用程序,並且用戶嘗試製作新的短信,你的應用程序將會被調用。 – lulumeya