AndroidToolkit.context

19 views
Skip to first unread message

Clark Kent

unread,
May 12, 2019, 10:08:27 PM5/12/19
to tablelayout-users
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()

Nate

unread,
May 13, 2019, 5:40:04 AM5/13/19
to tablelay...@googlegroups.com

--
--
You received this message because you are subscribed to the "tablelayout" group:
http://groups.google.com/group/tablelayout-users

---
You received this message because you are subscribed to the Google Groups "tablelayout-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tablelayout-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tablelayout-users/fc35bdc8-5df5-46ad-8873-be82137ec78e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages