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 4539676
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:58:46+00:00 2026-05-21T14:58:46+00:00

I have set up an ImageView in main.xml, if I want to access it

  • 0

I have set up an ImageView in main.xml, if I want to access it from my View class and make it visible = false, how can I do this programatically?

Thank you

    public void onCreate(Bundle savedInstanceState) {  
    super.onCreate(savedInstanceState);
    theView = new GameView(this);
    theView.setBackgroundResource(R.layout.main);
    setContentView(theView);
  • 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-21T14:58:47+00:00Added an answer on May 21, 2026 at 2:58 pm

    For example, in your layout xml file, there is a imageview1

    <ImageView
    android:id="@+id/imageview1"
    android:layout_gravity="center"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    />
    

    in your java src,

    ImageView img=(ImageView)findViewById(R.id.imageview1);
    img.setVisibility(View.GONE);
    img.setVisibility(View.VISIBLE);
    img.setVisibility(View.INVISIBLE);
    

    you can google the difference between View.Gone and View.VISIBLE

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

Sidebar

Related Questions

I have imageView in activity. How I can set position this imageView in my
I have a Imageview in main.xml, how to set the bitmap the to the
I have a OnClicklistener set to a image: iv_album[i] = new ImageView(main.this); iv_album[i].setImageBitmap(resized_a_p); iv_album[i].setPadding(width-resized_a_p.getHeight()-5,
I have an NSBox set up in my main view that accepts drag and
I have an ImageView in my main.xml file: <ImageView android:id=@+id/pageImage android:layout_width=270dp android:layout_height=45dp android:layout_alignParentLeft=true android:layout_alignParentTop=true
I have a problem with UIButton image if I set its imageView contentMode to
I have 2 xml files, a main file where I have a listView and
I have a listView, a main xml file and a customListview xml file. for
In ViewPagerAdapter.class I have 2 layout(whereami.xml and mapview.xml), and use LayoutInflater to inflate each
I have a grid view set up with an onitemclickListener but when i click

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.