कहा जाता है, मैंने getType() विधि में एक लॉग डाला है जिसे कभी मुद्रित नहीं किया जाता है। मैं नोटपैड नमूना कोड का उपयोग कर रहा हूँ। जावा दस्तावेज़ टिप्पणी की पहली पंक्ति कृपया बताएं। GetType() से रिटर्निंग नल भी ठीक काम कर रहा है। GetType() विधि का उद्देश्य क्या है?एंड्रॉइड कंटेंटप्रोवाइडर getType() को कब और क्यों
/**
* This is called when a client calls {@link android.content.ContentResolver#getType(Uri)}.
* Returns the MIME data type of the URI given as a parameter.
*
* @param uri The URI whose MIME type is desired.
* @return The MIME type of the URI.
* @throws IllegalArgumentException if the incoming URI pattern is invalid.
*/
@Override
public String getType(Uri uri)
{
Log.d("Suparna", "******getType()");
/*switch(uriMatcher.match(uri))
{
// ---get all books---
case BOOK_DETAILS:
return Book.Book_Details.CONTENT_TYPE;
// ---get a particular book---
case BOOK_DETAILS_ID:
return Book.Book_Details.CONTENT_ITEM_TYPE;
default:
throw new IllegalArgumentException("Unsupported URI: " + uri);
}*/
return null;
}
इस सवाल को कोई ध्यान क्यों नहीं मिला क्योंकि आप इसे "एंड्रॉइड" के साथ टैग करना भूल गए थे। :) –
http://stackoverflow.com/questions/5351669/why-use-contentprovider-gettype-to-get-mime-type आपकी मदद कर सकता है। – boiledwater