package com.example.yasminanunez.timetable;import android.app.ListActivity;import android.content.Context;import android.content.Intent;import android.support.v7.app.AppCompatActivity;import android.os.Bundle;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.ImageView;import android.widget.ListView;import android.widget.TextView;import android.widget.Toast;public class MainActivity extends ListActivity { ListView listView; String values = new String{“Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”}; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); listView = (ListView) findViewById(R.id.listView); setListAdapter(new MyCustomAdapter(this, R.layout.adapter_view_layout, values)); } public class MyCustomAdapter extends ArrayAdapter { // constructor public MyCustomAdapter(Context context, int textViewResourceId, String objects) { super(context, textViewResourceId, objects); } // This getview method is called each time a row needs to be formatted for the list @Override public View getView(int position, View convertView, ViewGroup parent) { LayoutInflater inflater=getLayoutInflater(); View row=inflater.inflate(R.layout.adapter_view_layout, parent, false); // row formatting… TextView label = (TextView)row.findViewById(R.id.day); label.setText(valuesposition); ImageView myImage = (ImageView)row.findViewById(R.id.myicon); if (valuesposition == “Monday”) { myImage.setImageResource(R.drawable.monday); } if (valuesposition == “Tuesday”) { myImage.setImageResource(R.drawable.tuesday); } if (valuesposition == “Wednesday”) { myImage.setImageResource(R.drawable.wednesday); } if (valuesposition == “Thursday”) { myImage.setImageResource(R.drawable.thursday); } if (valuesposition == “Friday”) { myImage.setImageResource(R.drawable.friday); } // return row; } // get View } // closes the custom adapter class @Override protected void onListItemClick(ListView l, View view, int position, long id) { if(position == 0){ Intent intent = new Intent(view.getContext(), Monday.class); startActivityForResult(intent, 0); } if(position == 1){ Intent intent = new Intent(view.getContext(), Tuesday.class); startActivityForResult(intent, 1); } if(position == 2){ Intent intent = new Intent(view.getContext(), Wednesday.class); startActivityForResult(intent, 2); } if(position == 3){ Intent intent = new Intent(view.getContext(), Thursday.class); startActivityForResult(intent, 3); } if(position == 4){ Intent intent = new Intent(view.getContext(), Friday.class); startActivityForResult(intent, 4); } }}