Hi
I have 24 teams in a list, I have 24 separate .java classes for each team with information about those teams. When the user click on an item(Team) in the list I want to goto that teams java file(Class) and display there information. below is the code,
import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; public class ll2 extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); String[] myList = new String[] {"Accrington Stanley", "Aldershot Town", "Barnet", "Bradford City", "Burton Albion", "Bury", "Cheltenham Town", "Chesterfield", "Crewe A", "Gillingham", "Hereford Utd", "Lincoln City", "Macclesfield T", "Morecombe", "Northampton T", "Oxford Utd", "Port Vale", "Rotherham Utd", "Shrewsbury T", "Southend Utd", "Stevenage", "Stockport C", "Torquay Utd", "Wycombe W"}; ListView lv = new ListView(this); lv.setAdapter(new ArrayAdapter(this,android.R.layout.simple_list_item_1,myList)); setContentView(lv); } public void onItemClick(AdapterView parent, View view,int position, long id) { Intent myList = new Intent(); myList.setClass(this, Bradford.class); if ("Bradford City".equals(myList)) startActivity(Bradford.java); } }
As you can see I have setup the Bradford class and I have registered this in android manifest but when I click on bradford nothing happens, also when I try to set up another intent for another team the mylist value cannot be used again.
How do I make this work