java - Not able to redirect to another intent in android -


i trying move intent click on 1 list item. in below example, need move intent matchinginterest clicked on attributes list.

but somehow whenever clicking on attributes list, not redirecting me towards matchinginterest page. idea why happening?

public class menufragment extends listfragment {      private string user_id = "1234";      @override     public void onactivitycreated(bundle savedinstancestate) {         super.onactivitycreated(savedinstancestate);         setlistadapter(new arrayadapter<string>(getactivity(),                 android.r.layout.simple_list_item_1, new string[] { " settings", " attributes"}));         getlistview().setcachecolorhint(0);     }      @override     public void onlistitemclick(listview l, view v, int position, long id) {          //get selected items         string selectedvalue = (string) getlistadapter().getitem(position);          if(selectedvalue.equals("attributes")) {             bundle bundle = new bundle();             bundle.putstring("userid", user_id);             intent thesisproject = new intent(getactivity(), matchinginterest.class);             thesisproject.putextras(bundle);              startactivity(thesisproject);         }     } } 

new string[] { " settings", " attributes"} 

you have space in of both of them.

'attrubutes' not equal ' attributes'


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -