Android Open Source - RandomMusicPlayer Input List Adapter

From Project

Back to project page RandomMusicPlayer.


The source code is released under:

Apache License

If you think the Android project RandomMusicPlayer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.matthew.ahsam.phoenix.randommusicplayer;
/*ww w  . j a  va 2 s.  co m*/
import java.util.ArrayList;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class InputListAdapter extends BaseAdapter {
  private Context context;
  private ArrayList <SongListChild> list;
  InputListAdapter (Context c, ArrayList <SongListChild> l) {
    context = c;
    list = l;
  public int getCount() {
    return list.size();

  public Object getItem(int position) {
    return list.get(position);

  public long getItemId(int position) {
    return position;

  public View getView(int position, View view, ViewGroup parent) {
    SongListChild child = (SongListChild) getItem(position);
    if(view == null) {
      LayoutInflater infalInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      view = infalInflater.inflate(R.layout.songlist_child, null);
    if (!child.isSelected()) {
    } else {
    TextView tv = (TextView) view.findViewById(;
    return view;

Java Source Code List