getApplicationContext() throws an exception when used

后端 未结 2 1606
渐次进展
渐次进展 2021-01-23 20:22

I\'ve specified a class, based on another one in an existing Android project. The addRow() method is supposed to dynamically add rows to a table. When creating a new TextView to

相关标签:
2条回答
  • 2021-01-23 20:58

    I guess you have to pass the context to the constructor of your class.

    0 讨论(0)
  • 2021-01-23 20:58

    Try this instead:

    TableRow tr = new TableRow(this);

    0 讨论(0)
提交回复
热议问题