hi i have two activities , first acivity has three icons one is invisible…when i click on the first actitvity it goes to the second activity using intent..my second activity is a login screen ,when the login is success i should come back to first activity and make an icon visible in the first acitivty..how can i go back to first activity from second activity and make the icon visible in first one..below is my login screen code
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.");
// details.setVisibility(View.VISIBLE);
} else {
lblResult.setText("password doesn't match.");
}
finish();}});
any suggestions/ help is appreciated…
Use
startActivityforResultto open the login activity..then in theonActivityResult(int, int, Intent)in your first activity show the icon..Example:
check http://developer.android.com/reference/android/app/Activity.html