Could someone please explain, when will the NoteList activity be spawned with intent actions ACTION_VIEW, ACTION_EDIT, ACTION_GET_CONTENT.
I tried commenting out the code for the particular intents below from NoteList activity, and the application worked just fine
<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>
Also inside NoteList activity, i did not find any handling for the below intent actions. So why even define them??
Say some startActivityFoorResult() calls this intent, how will this intent even be resolved inside NoteList when it does not have any handler inside NoteList activity.
Also who can and calls in the example the intent actions?
Links for android NotePad example is below.
http://developer.android.com/guide/topics/intents/intents-filters.html
http://developer.android.com/resources/samples/NotePad/index.html
Thanks in advance
If you notice the last line inside the intent filter, you’ll see that it specifies a mime type. This associates the app with that mime type. That means that when you open a file/url with that mime type, it will try to open it with this app. The fact that you removed the intent filter doesn’t necessarily mean that the app will stop working, it will simply no longer handle this mime type.
Inside NotesList.java you will see several references to
Intent.ACTION_EDIT,Intent.ACTION_PICK, etc. which are constants for"android.intent.action.EDIT"etc.Update:
If you look at the manifest file you’ll see that the min SDK version is set to 11. This is apparently a HoneyComb manifest file. I glanced at the code and it doesn’t seem like the code linked directly on the website uses fragments, but I strongly suspect that the manifest was for a version that uses fragments. I know for sure there’s a version out there with fragments as I’ve played with it at some point. Google used it for their recent Android Developer Labs. This would match up with the intent filter that you saw, as it would allow for editing/viewing/picking a note from the list which would open up the fragment to view/edit/etc. In short, I think the code and manifest are probably a little out of sync.