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

  • Home
  • SEARCH
  • 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 8908243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:07:47+00:00 2026-06-15T03:07:47+00:00

I have a linearlayout with three icons as below <ImageView android:id=@+id/cities android:layout_width=wrap_content android:layout_height=wrap_content android:src=@drawable/city

  • 0

I have a linearlayout with three icons as below

 <ImageView
            android:id="@+id/cities"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content          
            android:src="@drawable/city" />

        <ImageView
            android:id="@+id/red"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"           
            android:src="@drawable/red"
            android:visibility="gone" 
            />
        <ImageView
            android:id="@+id/deal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"       
            android:src="@drawable/deal" />

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) {
    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.");

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

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

            finish();
        }
    });
  • 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-06-15T03:07:48+00:00Added an answer on June 15, 2026 at 3:07 am

    You should make the ImageView details object a class variable, so that it can definitely be accessed by your listener later.

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

Sidebar

Related Questions

I have a LinearLayout and its child - ImageView. My activity's onCreate does nothing
I have this nice dialog view I set my UserInputDialog class to: <LinearLayout android:id=@+id/LinearLayout01
I have three ListView widgets in the same LinearLayout . Something like this (I'm
I have a layout which inludes actionbar and tabs: <TabHost xmlns:android=http://schemas.android.com/apk/res/android android:id=@android:id/tabhost android:layout_width=fill_parent android:layout_height=fill_parent>
I have a simple LinearLayout with one TextView and one ImageView. I want the
I have a layout that is three linear layouts. The top has some icons
I have a LinearLayout with a vertical orientation, within that layout I have three
I have three images in my drawable folder, and an XML Image Button code:
Ok I have a ViewFlipper with three LinearLayouts nested inside it. It defaults to
I have a simple vertical LinearLayout in which there is a button on the

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.