Understanding how to set a listener on a button in Android
There is a bit more to it when trying to create a button in Android and setting a listener to it. The new way hides a lot of the complexity but it also hides a lot of the understanding. The “traditional” way was: btn = (Button)findViewById(R.id.firstButton); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) {… Read More »