Note To Self continued
Open up the Note To Self app. As a reminder, if you want to see the completed code and working app after completing this chapter, it can be found in the Chapter 14/Note to self
folder. As the actions in this chapter require you to jump around between different files, classes, and methods, I encourage you to follow along with the files from the download bundle opened for reference.
Updating onCreate and preparing the UI
Now, let's prepare our UI. To do so, follow these steps:
- In the
layout_main.xml
file, delete the temporary button with abutton
ID that we added previously for testing purposes. - In the
onCreate
method ofMainActivity.java
, we can delete the anonymous class that handles its clicks. In order to do so, delete the code shown next:// Temporary code Button button = (Button) findViewById(R.id.button); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { DialogShowNote dialog = new DialogShowNote(); dialog...