This app structure is very simple and is suitable for a music player app.
It contains two activity, referring the two screens:
-MainActivity displays a scrollable list of ten Songs and a play image.Click on a row opens the second screen.
-DetailActivity displays in vertical layout, with properly label: tytle, artist and description of
the song you choose. It has also a button "GOTO YOUTUBE" to call the related video on YouTube.
The code runs without errors on my phone Android 7.0 Api 24
Each button’s behavior is determined by an OnClickListener in the
Java code rather than by the android:onClick attribute in the XML Layout
Each button properly opens the intended activity using an explicit Intent.
I use the example of Flavour App, seen in the lesson to realize the list with recycled view.
I create a custom adapter SongAdapter to populate the layout with views
based on instances of the custom class Song. It contains 4 states
(IdSong, Song Name, Artist Name, Description)
All information about the objects Song are stored in an ArrayList.
Copyright 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.