Can someone tell me where I am going wrong?
I'm trying to change my textview called MyText to something else, but when I try I get the error:
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.Window.findViewById(int)' on a null object reference at android.app.Activity.findViewById(Activity.java:2071)
public class MainScreen extends Activity {
TextView texting = (TextView) findViewById(R.id.MyText);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_screen);
texting.setText("Test");
};
}