I am trying to implement ProfilesActivity in my application. So imagine we are in a home activity / layout: UsersActivity, where we did addActions to launch the action bar, for example:
Intent addProfilesIntent = new Intent(this, ProfilesActivity.class); Action profilesAction = (Action) new IntentAction(this, addProfilesIntent, R.drawable.go_profiles); actionBar.addAction(profilesAction);
We click on the profile icon in our action panel and open a new layout (profiles_menu.xml), where I have a listView with checkables and an image for each profile (different profiles: work, home, auxiliary ...).
ListView list = (ListView) findViewById(R.id.list); ArrayList<HashMap<String, Object>> listData=new ArrayList<HashMap<String,Object>>(); String []name={" Company number"," Home number"," Handy number"," Auxiliary number"}; for(int i=0;i<4;i++){ HashMap<String, Object> map=new HashMap<String, Object>(); map.put("number_image", R.drawable.icon+(i+1)); map.put("number_name", name[i]); listData.add(map); } listItemAdapter = new CheckboxAdapter(this, listData); list.setAdapter(listItemAdapter); list.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
Now I want to do the following: when we select a profile, it should change the profile icon in the action bar on the main page (this is go_profiles in the code) to the selected profile icon. Do you know how to do this?

source share