E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.BroadcastConsole, PID: 16947
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.BroadcastConsole/com.example.broadcastConsole.grid.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3108)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3251)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1948)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7045)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
at android.view.ViewConfiguration.get(ViewConfiguration.java:476)
at android.view.View.<init>(View.java:5198)
at android.view.View.<init>(View.java:5393)
at android.view.ViewGroup.<init>(ViewGroup.java:660)
at android.view.ViewGroup.<init>(ViewGroup.java:656)
at android.view.ViewGroup.<init>(ViewGroup.java:652)
at android.view.ViewGroup.<init>(ViewGroup.java:648)
at com.esotericsoftware.tablelayout.Table.<init>(Table.java:35)
at com.esotericsoftware.tablelayout.Table.<init>(Table.java:31)
at com.example.broadcastConsole.grid.MainActivity.onCreate(MainActivity.kt:36)
at android.app.Activity.performCreate(Activity.java:7327)
at android.app.Activity.performCreate(Activity.java:7318)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3088)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3251)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1948)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7045)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)
Application terminated.
// Keep your code clean by creating widgets separate from layout.
val textView = TextView(applicationContext)
textView.text = "a".toString()
textView.setTextColor(Color.WHITE)
textView.setAutoSizeTextTypeWithDefaults(TextView.AUTO_SIZE_TEXT_TYPE_UNIFORM)
textView.setPadding(0, 0, 0, 0)
textView.setTypeface(Typeface.MONOSPACE, Typeface.BOLD)
val table = Table()