ユーザーのすべての受信トレイ電子メールのリストビューを作成しました。今すぐメールIDをクリックしてください。私はメールの内容を表示する活動をしたいと思っています。問題は、メールのIDをアクティビティに渡して、そのメールを詳細で取得する方法を理解できないことです。リストビューonClick passing _id
public class InboxActivity extends ListActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.inbox);
DBAdapter db = new DBAdapter(InboxActivity.this);
db.open();
long userID = Long.parseLong(MessagingApplication.getUserID());
Cursor inbox = db.readInbox(userID);
startManagingCursor(inbox);
String[] mails = new String[] { DBAdapter.KEY_SUB };
int[] to = new int[] { R.id.subject };
SimpleCursorAdapter inboxmail = new SimpleCursorAdapter(this,
R.layout.inbox_list, inbox, mails, to);
setListAdapter(inboxmail);
db.close();
}
}
これは、リストビュー