in my app i have a header with a icon common for all screens, which is in invisible mode when app starts…and also adapter which has all my results in listview…when user clicks the listview a login screenn appears and when the user login is successful the icon in the header should be visible ..i spend couple of hour finding how to make the icon visible when login is success
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fyelogin);
etPassword = (EditText)findViewById(R.id.password);
btnLogin = (Button)findViewById(R.id.login_button);
btnCancel = (Button)findViewById(R.id.cancel_button);
lblResult = (TextView)findViewById(R.id.result);
final ImageView details = (ImageView)findViewById(R.id.red);
btnLogin.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
String password = etPassword.getText().toString();
if(password.equals("guest")){
lblResult.setText("password successful.");
City.isIconvisible= false;
} else {
lblResult.setText("password doesn't match.");
}
finish();}});
Any suggestions is appreciated
If your app has user actions or global navigation, you can start use the
ActionBaras your header. If your app will cover older versions, I recommend the use of the library namedActionBarSherlock.So you should create an abstract activity and all your activities should extend it. So, when you don’t want that the action bar is visible, just use the hide() function (e.g.:
getActionBar().hide()).