Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8502585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:31:35+00:00 2026-06-11T01:31:35+00:00

I put a log in getType() method it never gets printed. I am using

  • 0

I put a log in getType() method it never gets printed. I am using the Notepad sample code. Please explain the 1st line of Java doc comment. Returning null from getType() is also working fine.
What is the purpose of getType() method?

    /**
 * 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;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T01:31:37+00:00Added an answer on June 11, 2026 at 1:31 am

    getType(Uri uri) will usually only be called after a call to ContentResolver#getType(Uri uri). It is used by applications (either other third-party applications, if your ContentProvider has been exported, or your own) to retrieve the MIME type of the given content URL. If your app isn’t concerned with the data’s MIME type, it’s perfectly fine to simply have the method return null.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the code below to compare the last line of a log minus
I am trying to put log message in the native code of Web kit
I just put log tags on most activity and fragment methods and this is
I am trying to put a log.txt file on the root of my application
I put together this quick carousel that I'm using to cycle through different divs
In C, I can put a log printf inside a function like this: void
How can I put log statements into a browser plugin written for Mac OS
I have this code if(ereg(^(https),$url)) curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,false); // execute, and log the result to curl_put.log
Is it possible to have log4net put its log files relative to the current
I Have problem When redirect to jsp . I Have put my servlet code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.