title: Using getAssets() gives the error "The method getAssets() is undefined for the type ClassName"?
body: <p>I am trying to open a file which is in the assets folder. But using getAssets() gives the error given above. I know I have to pass the context from another activity, but I can't do that either as then another error comes-"The method onCreate(SQLiteDatabase, Context) of type ClassName must override or implement a supertype method". So I am stuck. Is there a better way of opening that file? Here is the line:</p>
  
  <pre><code>InputStream is = getAssets().open("file1.txt");
  </code></pre>
  
  <p>*Note: ClassName is not an activity, it's just a class, so getAssets() cannot work without passing context from another activity.</p>
  
  <p>Edit: Here is the class and onCreate declaration:</p>
  
  <pre><code>public class DatabaseHandler extends SQLiteOpenHelper {
  @Override
  public void onCreate(SQLiteDatabase db) {//some stuff
  InputStream is = getAssets().open("file1.txt");
  //more stuff
  }
  }
  </code></pre>