Both Dialog
and TextView
constructors should be passed a Context
object, but you are passing them null
.
Since your activity extends Context
, you may pass an instance of your activity.
Assuming the name of your activity is MainActivity
then you would do this:
Dialog d = new Dialog(MainActivity.this);
TextView t = new TextView(MainActivity.this);
//...