이 포스팅은 아래 구글 코드랩을 개인 학습용으로 정리한 글입니다.
In the first task, you add the Fragment statically to the Activity layout
-> it is displayed for the entire duration of the Activity lifecycle
The user can interact with the radio buttons in the Fragment
-> choose either "Yes" or "No"
-> If the user chooses "Yes," the text in the Fragment changes to "Article: Like."
-> If the user chooses "No," the text in the Fragment changes to "Article: Thanks."
In the second task, you add the Fragment dynamically
-> your code adds, replaces, and removes the Fragment while the Activity is running
the user can tap the Open button
-> to show the Fragment at the top of the screen.
The user can then interact with the UI elements in the Fragment.
The user taps Close
-> to close the Fragment.
- In the instructions below, substitute your actual project names
-> ExistingProject and NewProject.
- Copy the project
- On your computer's file system (not in Android Studio)
-> make a copy of the ExistingProject directory.- Rename the copied directory to NewProject.
- Rename and refactor the project components
- Start Android Studio
-> Open an existing Android Studio project
-> select NewProject directory- Select Build > Clean Project to remove the auto-generated files
➖- See your files in the Project: Android view.
-> Right-click app > java > com.example.android.existingproject
-> select Refactor > Rename- A Warning dialog is displayed
-> select Rename package.
-> Select Search in comments and strings and Search for text occurrences.
-> Click Refactor.- The Find: Refactoring Preview pane appears
-> Click Do Refactor.
➖- Change the app_name string value to "New Project" in the strings.xml file