01.11.2014 Views

The AndroidManifest.xml File - 안드로이드 기술 커뮤니티 : Korea ...

The AndroidManifest.xml File - 안드로이드 기술 커뮤니티 : Korea ...

The AndroidManifest.xml File - 안드로이드 기술 커뮤니티 : Korea ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Parcel : Activie Objects (<strong>File</strong>Descriptor)<br />

protected final Parcel<strong>File</strong>Descriptor open<strong>File</strong>Helper(Uri uri, String mode) throws <strong>File</strong>NotFoundException {<br />

Cursor c = query(uri, new String[]{"_data"}, null, null, null);<br />

int count = (c != null) ? c.getCount() : 0;<br />

if (count != 1) {<br />

// If there is not exactly one result, throw an appropriate<br />

// exception.<br />

if (c != null) {<br />

cclose(); c.close();<br />

}<br />

if (count == 0) {<br />

throw new <strong>File</strong>NotFoundException("No entry for " + uri);<br />

}<br />

throw new <strong>File</strong>NotFoundException("Multiple ti lti l items at " + uri);<br />

}<br />

c.moveToFirst();<br />

int i = c.getColumnIndex("_data");<br />

(_ String path = (i >= 0 ? c.getString(i) : null);<br />

c.close();<br />

if (path == null) {<br />

throw new <strong>File</strong>NotFoundException("Column _data not found.");<br />

}<br />

}<br />

int modeBits = ContentResolver.modeToMode(uri, mode);<br />

return Parcel<strong>File</strong>Descriptor.open(new <strong>File</strong>(path), modeBits);<br />

<strong>Korea</strong> Android Community- www.kandroid.org<br />

29

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!