Imageview visibility in Android

Viewed 50212

In the following code how to hide the image at the start of the APP.So when the user enters the password then show it back again

package com.app.myapp;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

public class MyappActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    ImageView.setVisibilty(View.INVISIBLE);
    Button btn=(Button) findViewById(R.id.enter);
    btn.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            String prepwd="password";
            EditText  et=(EditText) findViewById(R.id.pwd);
            if(et.getText().toString().equalsIgnoreCase(prepwd))
            {
                ImageView iv=(ImageView) findViewById(R.id.im1);
            }

        }
    });
}
}
1 Answers
Related