title: How to fix java.lang.InstantiationException?
body: <p>I'm trying to export my database using FAB. This is the error</p>
  
  <blockquote>
    <p>java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.qrac1/com.example.qrac1.ClassInfoActivity}: java.lang.InstantiationException: java.lang.Class (com.example.qrac1.ClassInfoActivity) has no zero argument constructor</p>
  </blockquote>
  
  <p>Everything was working until I inserted this codes:</p>
  
  <pre><code>FloatingActionButton fab1 = (FloatingActionButton) findViewById(R.id.fab1);
      fab1.setOnClickListener(new View.OnClickListener() {
          Intent sIntent = getIntent();
          ExampleClass sClass = sIntent.getParcelableExtra("selected");
          String selCode = sClass.getqCode();
  
          @Override
          public void onClick(View v) {
              exportDataBaseIntoCSV();
          }
      });
  }
  
  
  
  public void exportDataBaseIntoCSV(){
      Intent sIntent = getIntent();
      ExampleClass sClass = sIntent.getParcelableExtra("selected");
      String selCode = sClass.getqCode();
  
      ClassDB db = new ClassDB(context);//here CredentialDb is my database. you can create your db object.
      File exportDir = new File(Environment.getExternalStorageDirectory(), "");
  
      if (!exportDir.exists())
      {
          exportDir.mkdirs();
      }
  
      File file = new File(exportDir, selCode +".csv");
  
      try
      {
          file.createNewFile();
          CSVWriter csvWrite = new CSVWriter(new FileWriter(file));
          SQLiteDatabase sql_db = db.getReadableDatabase();//here create a method ,and return SQLiteDatabaseObject.getReadableDatabase();
          Cursor curCSV = sql_db.rawQuery("SELECT * FROM "+selCode,null);
          csvWrite.writeNext(curCSV.getColumnNames());
  
          while(curCSV.moveToNext())
          {
              //Which column you want to export you can add over here...
              String arrStr[] ={curCSV.getString(0),curCSV.getString(1), curCSV.getString(2), curCSV.getString(3), curCSV.getString(4), curCSV.getString(5), curCSV.getString(6), curCSV.getString(7), curCSV.getString(8), curCSV.getString(9), curCSV.getString(10), curCSV.getString(11)};
              csvWrite.writeNext(arrStr);
          }
  
          csvWrite.close();
          curCSV.close();
      }
      catch(Exception sqlEx)
      {
          Log.e("Error:", sqlEx.getMessage(), sqlEx);
      }
  
  }
  </code></pre>
  
  <p>This is the first time that I see this error so I don't have any idea how can I fix this.</p>