有人請解釋一下,NoteList活動何時會產生意圖動作ACTION_VIEW,ACTION_EDIT,ACTION_GET_CONTENT。Android記事本應用程序的NoteList活動意圖解析
我想註釋掉從NoteList活動下的具體意圖的代碼,應用效果很好
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT" />
<action android:name="android.intent.action.PICK" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.dir/vnd.google.note" />
</intent-filter>
而且NoteList活動中,我沒有發現任何處理爲以下意圖的行爲。那爲什麼要定義它們?
說一些startActivityFoorResult()調用這個意圖,當它在NoteList活動中沒有任何處理程序時,這個意圖甚至可以在NoteList中解決。 誰還可以在示例中調用intent操作?
android NotePad示例的相關鏈接如下。
http://developer.android.com/guide/topics/intents/intents-filters.html
http://developer.android.com/resources/samples/NotePad/index.html
在此先感謝
是不是從NoteList活動引用ACTION_EDIT對應於調用NoteEdit活動? ACTION_EDIT應該產生NoteEdit活動吧?從最後一行中的示例.. //發出一個Intent來啓動一個可以處理ACTION_EDIT的Activity。 // Intent的數據是備註ID URI。效果是調用NoteEdit。 startActivity(new Intent(Intent.ACTION_EDIT,uri)); – devgp
啊,我明白你的意思了。我匆匆看了一下你的帖子。是的,你在NotesList中使用這些操作是正確的。我會更新一些解釋。 – kabuko