• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with clickable Listview

 
jonathan d roberts
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 clicks on an item(Team) in the list I want to it to goto that teams java file(Class) and display there information. below is the code,






What I want to happen is when a user selects the team Bradford say, I want it to goto the Bradford.java class and if someone selects Accrington I want it to go to the Accrington.java class.

Thanks in Advance
 
Ankit Garg
Sheriff
Posts: 9580
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
startActivity method takes an Intent as an argument, not a java file name. You can make the class of your intent dynamic using reflection API (see example here). Another approach to this would be to assign a different action to each of your activity classes and invoke an action instead of a specific class using an Intent (in reality I'm not even sure if Bradford.java and Accrington.java even contain an activity or a normal class)...
 
Antony Keerthy
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use like this




For this listactivity example you can also view http://android-codes-examples.blogspot.com/2011/03/listactivity-with-checkbox-using.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic