How to programmatically hide Imageview

How to programmatically hide Imageview

I have a linearlayout with three icons as below

I have a linearlayout with three icons as below

            android:src="@drawable/city" />

        android:src="@drawable/deal" /&gt;

initially the middle icon is hidden (android:visibility="gone") I have a login screen..when the login i success I want the icon to be visible ..tried as below..but itz not working

public void onCreate(Bundle savedInstanceState) {

etPassword = (EditText)findViewById(;
btnLogin = (Button)findViewById(;
btnCancel = (Button)findViewById(;
lblResult = (TextView)findViewById(;

final ImageView details = (ImageView)findViewById(; 

btnLogin.setOnClickListener(new OnClickListener() {
    public void onClick(View v) {

        String password = etPassword.getText().toString();

            lblResult.setText("password successful.");

giving error @ this line  -----&gt;  details.setVisibility(View.VISIBLE);

        } else {
            lblResult.setText("password doesn't match.");


Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Android App Development Company in UAE

Have a plan to build an robust Android App Development with multiple features? We at Data EximIT is one of the best **[Android App Development Company in UAE]( "Android App Development...

Kotlin Coroutines on Android - How to use Coroutines on Android

Coroutines are a Kotlin feature that convert async callbacks for long-running tasks, such as database or network access, into sequential code. This Kotlin Coroutines tutorial will show you how to use coroutines on Android, and how the new androidx-concurrent library makes it easy to use them to get things off the main thread. You'll also learn how the new library helps coroutines work with Architecture Components. This session also covers coroutine patterns, best practices, and even how to test coroutines!

Best Android App Development Company New York

Are you looking for the [Best Android App Development Company in New York]( "Best Android App Development Company in New York")? if yes? then you have come to the right place....