im fairly new to android development, but i m having some trouble trying to make my listview items open up one activity but with a different drawable in it depending on the item. Is there anyway to view.getContext() with a specific drawable attached to that. here is my listview class:
lv.setOnItemClickListener (new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// When clicked, bring up MockClass.class
if(position == 1)
{
Intent myIntent = new Intent(view.getContext(), MockClass.class);
startActivityForResult(myIntent, 0);
}
if(position == 2)
{
Intent myIntent = new Intent(view.getContext(), MockClass.class);
startActivityForResult(myIntent, 0);
}
if(position == 3)
{
Intent myIntent = new Intent(view.getContext(), MockClass.class);
startActivityForResult(myIntent, 0);
}
if(position == 4)
{
Intent myIntent = new Intent(view.getContext(), MockClass.class);
startActivityForResult(myIntent, 0);
}
if(position == 5)
{
Intent myIntent = new Intent(view.getContext(), MockClass.class);
startActivityForResult(myIntent, 0);
}
if(position == 6)
{
Intent myIntent = new Intent(view.getContext(), MockClass.class);
startActivityForResult(myIntent, 0);
}
if(position == 7)
{
Intent myIntent = new Intent(view.getContext(), MockClass.class);
startActivityForResult(myIntent, 0);
}
if(position == 8)
{
Intent myIntent = new Intent(view.getContext(), MockClass.class);
startActivityForResult(myIntent, 0);
}
if(position == 9)
{
Intent myIntent = new Intent(view.getContext(), MockClass.class);
startActivityForResult(myIntent, 0);
}
if(position == 10)
{
Intent myIntent = new Intent(view.getContext(), MockClass.class);
startActivityForResult(myIntent, 0);
}