The problem is that when I run my code the app is stopping with an error (java.lang.RuntimeException: Unable to start activity ComponentInfo{com.twixt.pranav.pos/com.twixt.p
Your param passed to SQLiteHelper is null. You can get the activity context once the fragment is attached to the activity.
Check the lifecycle of fragment https://developer.android.com/guide/components/fragments.html
Change
private val database: SQLiteHelper = SQLiteHelper(activity)
to
private var database: SQLiteHelper? = null
Overide onAttach in Fragment and initialize database
database = SQLiteHelper(activity)
https://developer.android.com/reference/android/app/Fragment.html#onAttach(android.app.Activity)