google-developer-training / first-android-app

Repository for Build Your First Android App codelabs (Java and Kotlin)
7 stars 6 forks source link

First Android App codelab: data binding update #210

Open dford0009 opened 2 years ago

dford0009 commented 2 years ago

COUNT BUTTON:

binding.countButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { countMe(view); } });

countMe Method:

private void countMe(View view){ String countString = binding.textviewFirst.getText().toString(); Integer count = Integer.parseInt(countString); count++; binding.textviewFirst.setText(count.toString()); }