title: Accessing an inner subclass with private class constructor from another class
body: <p>I'm creating SQL Database and i base on <a href="https://developer.android.com/training/basics/data-storage/databases.html#WriteDbRow" rel="nofollow noreferrer">this site.</a>
  The problem is, i don't know how can i access inner class' methods, while outer class has private constructor.</p>
  <pre><code>public class MyDBHandler {
  
      private MyDBHandler() {
      }
  
      public static class FeedEntry implements BaseColumns {
          public static final String TABLE_NAME = &quot;Tasks&quot;;
          public static final String COLUMN_NAME_TITLE = &quot;TASK_LABEL&quot;;
      }
  
      public class FeedReaderDbHelper extends SQLiteOpenHelper {
          public static final int DATABASE_VERSION = 1;
          public static final String DATABASE_NAME = &quot;myDatabase.db&quot;;
  
          public FeedReaderDbHelper(Context context) {
              super(context, DATABASE_NAME, null, DATABASE_VERSION);
          }
  
          public long saveTasks(String title) {
              SQLiteDatabase db = this.getWritableDatabase();
  
              ContentValues contentValues = new ContentValues();
              contentValues.put(FeedEntry.COLUMN_NAME_TITLE, title);
  
              long newRowId = db.insert(FeedEntry.TABLE_NAME, null, contentValues);
              return newRowId;
  
          }
      }
  } 
  </code></pre>
  <p>I'm trying to access saveTasks(String title) method from onClick(View v) method from an another java file.</p>
  <p>I tried sth like this:</p>
  <pre><code>MyDBHandler.FeedReaderDbHelper dbHelper = new MyDBHandler.FeedReaderDbHelper(v.getContext());
  </code></pre>
  <p>but of course i get an &quot;MyDBHandler is not an enclosing class&quot; error.</p>
  <p>OR</p>
  <pre><code>MyDBHandler.FeedReaderDbHelper dbHelper= new MyDBHandler().new FeedReaderDbHelper(v.getContext());
  </code></pre>
  <p>but again, Android studio keeps telling me: &quot;MyDbHandler has a private access&quot;</p>
  <p>Is it even possible to do it that way?</p>