1
public class SearchableActivity extends ListActivity {
    String options[]={"got nothing here "};
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        /*
        Uri uriSMSURI = Uri.parse("content://sms/inbox");
        Cursor cur = getContentResolver().query(uriSMSURI,new String[] { "_id", "thread_id", "address", "person","date", "body" }, null, null,null);
        int i=0;
        if(cur.getCount()>0) {
            while(cur.moveToNext()) {
                String smsBody = cur.getString(5);
                options[i++]=smsBody;
            }
        } else {
            options[0]="got nothing here ";
        }
        cur.close();
        */
        setListAdapter(new ArrayAdapter<String(this,android.R.layout.simple_list_item_1, options));
    }

コメント/**/内のコードにより、アプリがクラッシュします。

AVDの受信トレイはデフォルトで空ですか?

はいの場合、どうすればそれにいくつかのメッセージを送ることができますか?

4

2 に答える 2

2

EclipseDDMSPrespectiveでDDMSを使用してAVDにメッセージを送信できます:)

メニューウィンドウに移動-> Prespectivを開く->DDMSprespective->エミュレータタブ->SMSの送信。

于 2013-03-26T07:47:24.420 に答える
1

Telnet経由で実行中のエミュレーターに接続します(5554はエミュレーター番号です)。

telnet localhost 5554 

次のように入力します。

sms send phoneNumber textmessage
于 2013-08-01T11:45:33.777 に答える