In my app I have a header with icon hidden, I have a adapter with a listview when I click the listview I go to a login screen using listener, when the login is successful is should come back to listview(adapter) and icon should get visible on header. i am sending intent as follows: http://pastebin.com/4SKnyjVX
below is onclick the login button
public void onClick(View v) {
String password = etPassword.getText().toString();
if(password.equals("guest")){
Intent returnIntent = new Intent();
returnIntent.putExtra("result",result);
setResult(1,returnIntent);
finish();
} else {
//----
}
finish();
}
how can i use onActivityResult to set a flag and use this flag in click listener,
and also use it to make the icon visible. Any suggestion is appreciated
In your previous activity where you have listview with hidden icon in header, override the function onActivityResult() something like this –
And I’ve changed your onClick this way