Created
July 1, 2017 23:05
-
-
Save jshvarts/ab75b3d9ff60f518c27741409a44f911 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ViewModelDemoActivity extends LifecycleActivity { | |
@BindView(R.id.click_count_text) | |
protected TextView clickCountText; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_viewmodel_demo); | |
ButterKnife.bind(this); | |
} | |
@OnClick(R.id.increment_button) | |
public void incrementClickCount(View button) { | |
int currentClickCount = Integer.parseInt(clickCountText.getText().toString()); | |
clickCountText.setText(String.valueOf(++currentClickCount)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment