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
//Okay so this is the basic concept I used in my Now Playing activity. | |
//Essentially we want to get the current index of the selected song in the Arraylist | |
//Then create a temporary reference and either add to it or subract from it | |
//And then refresh the TextViews based on the new position in the ArrayList | |
//First things first, make sure you have global variables for your TextViews and your ArrayList itself. | |
ArrayList<songs> SongItems = new ArrayList<>(); | |
//This is called after using .setOnClickListener(this) -- and implementing View.OnClickListener on my public class | |
@Override |
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 LocationDetailActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.location_detail); | |
//This is where you'll get the Intent extras | |
//Then you'll want to assign those strings and integer values to your TextViews, ImageViews just like you would with any other activity. |
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 FragmentName extends Fragment { | |
ArrayList<songItem> SongItems; | |
ArrayList<genreItem> GenreItems; | |
public View onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
final View view = inflater.inflate(R.layout.fragment_name, container, false); | |
songArrayList songs = new songArrayList(); | |
SongItems = songs.getSongList(); | |
GenreItems = songs.getGenreList(); | |
NewerOlder