title: how to fix "Unknown URL content://com.new.newapp.locations/locations" in android studio
body: <p>This is the error I am getting:</p>
  
  <pre><code>Caused by: java.lang.IllegalArgumentException: Unknown URL  content://com.new.newapp.locations/locations
          at android.content.ContentResolver.insert(ContentResolver.java:1213)
          at com.new.newapp.activity.FragmentGoogleMap$LocationInsertTask.doInBackground(FragmentGoogleMap.java:364)
          at com.new.newapp.activity.FragmentGoogleMap$LocationInsertTask.doInBackground(FragmentGoogleMap.java:360)
  </code></pre>
  
  <p>And I have researched this problem and found these similar questions:
      <a href="https://stackoverflow.com/questions/29175716/illegalargumentexception-unknown-url-content-content">Link1</a>
      <a href="https://stackoverflow.com/questions/28551428/android-contentprovider-uri-issue-unknown-url-content">Link2</a>
      <a href="https://stackoverflow.com/questions/8208223/error-in-insert-data-in-own-content-provider">Link3</a></p>
  
  <p>And non of these helped.  What bugs me a lot is that when I was using eclipse I didn't have this issue, but since working on Android Studio I can't seem to get this working.</p>
  
  <p>in my <code>LocationsContentProvider</code> class:</p>
  
  <pre><code>package com.new.newapp.activity;
  
  public class LocationsContentProvider extends ContentProvider{
  
  public static final String PROVIDER_NAME ="com.new.newapp.activtiy.locations";
  public static final Uri CONTENT_URI = Uri.parse("content://" + PROVIDER_NAME + "/locations" );
  private static final int LOCATIONS = 1;
  private static final UriMatcher uriMatcher ;
  
  static {
      uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
      uriMatcher.addURI(PROVIDER_NAME, "locations", LOCATIONS);
  }
  
  LocationsDB mLocationsDB;
  </code></pre>
  
  <p>And in my manifest I have this:  </p>
  
  <pre><code>&lt;/activity&gt;
  
      &lt;provider
          android:name="com.new.newapp.activity.LocationsContentProvider"
          android:authorities="locations"
          android:exported="false" /&gt;
  
  &lt;/application&gt;
  </code></pre>
  
  <p>I have tried <code>android:authorities="com.new.newapp.activity.locations"</code> 
  I have also tried <code>android:name=".LocationsContentProvider"
  Have also moved</code>
  
  <p>Could some one please help?  </p>