case R.id.menu_add:
startActivity(new Intent(Intent.ACTION_INSERT, getIntent().getData()));
return true;
하.... 참 힘드네요 안드로이드공부 ㅠ_ㅠ 하지만 여러분들의 도움을 빌어 계속 나아가보겠습니다
일단 이부분이 암시적인텐트(implicit intent)라는건 알겠습니다!!
근데 책예제는 Intent.ACTION_DIAL, "전화번호" 나 Intent.ACTION_VIEW, "URL주소" 이런식이라 한눈에 확 들어오는데
NotePad예제 같은 경우에는 Intent.ACTION_INSERT 이부분도 명확하게 이해가 안갈뿐더러...
getIntent().getData() 이부분은 위에서 setData를 해줘서 content://com.google.provider.NotePad/notes이런 형태가
URI로 들어가 있습니다. 아래 매니페스트보면 NoteEditor에 유일하게 action.INSERT가 있더라구요
그리고 NoteEditor가 또 하나의 Activity인데요.
여기까지의 데이터로 제가 분석한 결과는 NoteEditor의 Activity에 content://com.google.provider.NotePad/notes 이 URI에 상응하는 정보를 적용해야되는게 아닌가라고 생각했습니다만 도저히 URI에 대한 정보를 찾을 수가 없습니다...
제가 혹시나 잘못이해하고 있거나 첨부한 소스 이외에 더 알아야될 부분이나 확인해봐야될 부분이 있다면 충고부탁드립니다.
매니페스트에서의 설정부분에 대한 내용을 첨부해보겠습니다
=================================================
<activity android:name="NoteEditor"
android:theme="@android:style/Theme.Holo.Light"
android:screenOrientation="sensor"
android:configChanges="keyboardHidden|orientation"
>
..............생략.................
<intent-filter>
<action android:name="android.intent.action.INSERT" />
<action android:name="android.intent.action.PASTE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.dir/vnd.google.note" />
</intent-filter>
</activity>
api에 있는 Intent.ACTION_INSERT 설명 부분입니다
======================================
주어진 컨테이너에 빈 아이템을 넣어라...... 이게 무슨 의미인가요... 그 컨테이너가 NoteEditor인거 같은데 아이템은??ㅠㅠ
Activity Action: Insert an empty item into the given container.
Input: getData
is URI of the directory (vnd.android.cursor.dir/*) in which to place the data.
Output: URI of the new data that was created.