Skip to content Skip to sidebar Skip to footer

Nullpointerexception Thrown On Textview Settext()

Been debugging for a while... Help? Yes, I know what caused it, but idk how to fix it... public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

Solution 1:

You're missing actual line data, but I'd guess there is an error in your layout file (namely that you don't have one).

Somewhere after the super.onCreate(savedInstanceState); call you need to call setContentView with a layout id. Because you aren't setting a layout t =(TextView) findViewById(R.id.textView1); is returning null, and when you try and call setText it is failing.

Post a Comment for "Nullpointerexception Thrown On Textview Settext()"