I have created four tabs with listview in each. I am trying to make the list view clickable, I listview Tutorials include string xml and rs. Used to create list view using right:
The problem is that when I use my intent and IItemClickListener I get many marker errors, if I use comma brackets and class body markers If I take errors around to play together, then this is a syntax which is a problem or it is to keep the code or designation out of the code;
public class LLL extends list expansion {stable final string} Albbon "," Bury "," Shelton Town "," Chesterfield "," Crave Alexandra "}; Override public zeroes on @Create (bundle saved instanestate) {super.naught (savedinstenstate); Final String [] Teams = Miller Resources () GetStringArray (R. Wright.Titoma_Are); SetListAdapter (new array adapter & lt; string & gt; (this, rl.litt_it_itum, teams)); ListView lv = getListView (); Lv.setTextFilterEnabled (true); Lv.setOnItemClickListener (new OnItemClickListener) {public void onItemClick (AdapterView & lt ;? & gt; parent, view view, integer position, long ID) {public void onListItemClick (ListView, parent, View v, int position, long id );} If (status == "Brawford City") {intent = new intent (this, Bradford class); beginning (intent);}}
I get these errors here : Street Finals String [] Team = New String [] {"Accrington Stanley", "Aldershot", "Barnett", "Bradford City", "Burton Albbon", "Bury", "Shelley
Syntax error, enter "}" to complete Classbody
P> If I get a full class body I get more error here and elsewhere.I get these errors here:
listItemClick (ListView, parent , View v, int position, long id);}
Multiple markers on this line - Syntax error on Token, Wrong creation (S) - Syntax Session error, local Viriabl declaration full to enter "-" syntax error "token," for ,; Required - Syntax error on the token "(", = expected - syntax error on token ", expected - syntax error,"} ", MathodeBody - Syntax error, enter"} "to complete Classbody - on token Syntax error "}", delete this token
In the same problem I have tried different combinations and it gives me constant error with this setup. I have at least the errors
< P> any help enough Staying
setOnItemClickListener
everything is fine, where it's a mess
1 lv.setOnItemClickListener (New OnTimeClicklist) {2 Public Zero IITMClick (adaptiveview & lt ;? & gt; parent, view view, integer status, long ID) { 3 4 List ElementClick on Public Zero (List View, Guardian, View V, Int Position, Long ID); 5} 6 7 If (Status == "Browford City") {8 Intent Intense T = No A. Intent (this, Bradford, Class); 9 Initial (Intent); 10} 11 12
- Line 2: You close the
onItemClick
method definition Do not, so add a brace}
. - Line 4: Semicolon
;
should not end with an open brace{
- Line 7: You can not compare
string
- A
int
(position
) 7-10 rows with inside a method definition, such as before line 5, take them - Line 11: You must close the
new OnItemClickListener ()
, you must call line 1 and call atsetOnItemClickListener
call:});
- Line 12: You must close the class
ll2
with a brace}
.
In addition, ListActivity
already comes with a onListItemClick
method, so you do not need the code above Is onCreate
& mdash; There is no need to define your own listener.
Just add a new method to your class, followed by onCreate
:
List list, listView l, see V, int Position, long id) {if (condition == 3} {intention intended = new intention (this, Bradford. Class); StartActivity; }}
Comments
Post a Comment