Tuesday, April 29, 2014

Click to jump when the ListView item (carrying data)


Just beginning to learn Android. . In writing a ListView
There is probably a list of roughly information. . Click on an item after entering an information details Activity.
The weak residue data into a List <> in order to display the ListView.
But writing onItemClick (AdapterView Parent, View view, int position, long id) when I do not know how to write ==
I do not know how to get what I want, just a message from the List <> in. .

At the same time how to get to the intent to write the contents inside the Activity in the details after
Great God seeking help. .
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Object data_item = data.get (position);
Reply:
cited a floor hjywyj reply:
Object data_item = data.get (position);

Blessings, that at the time on the extra pass inside with no need to convert it into a String type

If converted. How in later Activity in the reversed type my custom. .
Reply:
reference to the second floor u014183164 reply:
that in passing on the extra time which is not converted to a String type with it
< br />It depends on your List where T is what type of.
Reply:
reference to the third floor hjywyj reply:
Quote: references to the second floor u014183164 reply:
put it in In extra time inside pass by without converting it into a String

It depends on your List where T is what type of.


Is to write an entity class ==
Reply:
references, 4th Floor u014183164 reply:
is to write an entity class ==

Model implements Serializable
Reply:
http://blog.csdn.net/xyz_lmn/article/details/5908355
Reply:
reference to the 6th floor hjywyj reply:
http://blog.csdn.net/xyz_lmn/article/details/5908355


Thank you, thank you very useful ~ ~
Reply:
New End Adapter, the Adapter settings to list , click on which one item, you can use list.get (postion). Taken to click on the corresponding data. And then passed out.

Reply:
reference to the 8th floor leehu1987 reply:
New End Adapter, the Adapter is set to list , click on which one item, you can use list.get ( postion). taken to click on the corresponding data. And then passed out.

Thank you ~ ~ have been resolved

No comments:

Post a Comment