这是myDiary这个工程下MainActivity中的protected void onListItemClick(ListView l, View v, int position, long id){}方法,
new Intent(String action,Uri uri)构造器的具体说明如下,
protected void onListItemClick(ListView l, View v, int position, long id) {
// 重要
// Returns: a new URI with the given ID appended to the end of the path
Uri uri = ContentUris.withAppendedId(getIntent().getData(), id);
/*
* new Intent.Intent(String action, Uri uri)这种用法还不太熟悉
* 系统会根据第一个参数(action)在清单文件中找对应的activity,如果对应为多个activity,
* 此时就会弹出一个dailog选择Activity
*/
startActivity(new Intent(MyDiaryEdit.EDIT_TEXT_ACTION, uri)); }