[Solved] Android code not working
Change your onCreate View like This: TextView textView; ImageView imageView; Button eat; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); textView = (TextView) findViewById(R.id.textView); imageView = (ImageView) findViewById(R.id.bc); eat = (Button) findViewById(R.id.button); eat.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { eat(); } }); // Calling member function uneat(); } public void eat() { textView.setText(R.string.changed_shit); … Read more