Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6062853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:05:56+00:00 2026-05-23T09:05:56+00:00

In the following code how to hide the image at the start of the

  • 0

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 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:05:57+00:00Added an answer on May 23, 2026 at 9:05 am

    You can modify the visibility of a view with view.setVisibility(x);, where x is View.INVISIBLE, View.VISIBLE, or View.GONE.

    You should probably define the image as invisible in your layout XML… android:visibility="invisible"

    You can’t set visibility on ImageView as your code shows, you must findViewById() to get the view to set visibility on. You seem to be doing that with your iv variable already, so just call the setVisibility() method on it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use the following code to hide and show a box on a bunch
I know that the following code should show and hide a tiny circular progress
I am using following code to show a spinning wheel: $(#loading) .hide() .ajaxStart(function(){ $(this).show();
Im using the following code <script src=http://code.jquery.com/jquery-latest.js></script> <script> //Document ready $(document).ready(function(){ //Show info $('a.getinfo').live(click,
I have the following code: $('.my-image').function(){ $(this + ' div').show(); }, function(){ $(this +
I'm using the following jQuery code to hide and show some HTML element in
I have following piece of code: $(document).ready(function(){ $(#cont).hide(); $(#slide).show(); $('#slide').click(function(){ $(#cont).slideToggle(); $(#slide).css(background-image, url('img/slideup.png')); });
I am trying to use the following code to hide the soft keyboard when
In the following code I would like to hide Hello world but keep visible
I have the following code: $('.breadcrumb:contains(,)').hide(); It does as expected and hides the entire

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.