Check out the import part of your class that uses the MyDatabaseHelper class. Your getHelper method seems to use the wrong default constructor.
Your error message,
java.lang.IllegalStateException: Could not find public constructor that has a single (Context) argument for helper class class com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper
If you use the MyDatabaseHelper class correctly, it should be
java.lang.IllegalStateException: Could not find public constructor that has a single (Context) argument for helper class class 'yourpackage'.MyDatabaseHelper
To explain the error
By default, the OrmLiteSqliteOpenHelper class has only a constructor, as shown below, it does not have a constructor that has one argument (context).
public DatabaseHelper(Context context, SQLiteDatabase.CursorFactory factory) { super(context, DATABASE_NAME, factory, DATABASE_VERSION); }
Therefore, this may cause an IllegalStateException error.
source share