how to visible layout in android

Harpal Singh

am working on android application in which there is two activity that is main activity and mode activity. my first activity is main activity have some invisible icon, enter image description here and second activity is mode activity .when i click on button in my second activityenter image description here i cam back my first activity i want that invisible icon should visible. enter image description here

enter code here

  pro.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            autobtn.setImageResource(R.drawable.auyto);
            pro.setImageResource(R.drawable.proactiv);
            Intent it = new Intent(ModeActivity.this, Mainactivity.class);
            startActivity(it);
        }
    });
Sandeep Bhandari

you can hide view using

yourView.setVisibility(View.GONE);

You can get the reference to your view by using findViewByID :) and when you want to get it back just say yourView.setVisibility(View.VISIBLE);

As per your question,in your Mode activity's onCreate or onStart you can hide your invisible icons like

    @Override
    protected void onStart(){
        super.onStart();
        yourView.setVisibility(View.GONE);
    }

and in onClickListener of the button of your mode activity you can make the button visible. In onclickListener of your button put the code

   yourView.setVisibility(View.VISIBLE); 

Thats all.If you want the icons to appear and hide on alternate taps on same button (use button like toggle) then put the below code

 if (yourView.getVisibility() == View.VISIBLE) {
      yourView.setVisibility(View.GONE); 
  } else {
      // Either gone or invisible
      yourView.setVisibility(View.VISIBLE); 
  }

Hope it helps :)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Android Linear Layout is not visible

From Dev

Invisible Layout not visible when make it visible in Android

From Dev

Android layout title bar is not visible

From Dev

Android Get height of the visible layout programmatically

From Dev

Last cell is not visible in custom Android ListView layout

From Dev

Layout not visible in Full Screen Activity in Xamarin Android

From Dev

Phonegap - Android How to adjust layout in Full Screen Mode when softkeyboard is visible

From Dev

How can I export Layout or Views as images to visible gallery folder in Android?

From Dev

how to visible nested layout when click root layout?

From Dev

Android: How to set drawable visible

From Dev

how to check alert is visible android

From Dev

Android: How to set drawable visible

From Dev

how to check alert is visible android

From Dev

Android Soft Keyboard freezes visible layout until closed

From Dev

How to achieve this layout in Android?

From Dev

How to Construct this Layout in Android?

From Dev

How to create a pagination for dynamically created table layout using set visible?

From Dev

How do I layout the body properly with an always-visible sidebar?

From Dev

How to keep columns content visible (sticky) in a 3 columns layout?

From Dev

How to fix scrolling to a visible cell in UICollectionView with custom layout?

From Dev

How to get children of a layout manager that are not yet visible in recyclerview adapter?

From Dev

Android: how to sync layout and layout-land

From Dev

How to merge Linear Layout and Table Layout at android?

From Dev

how to see layout on graphical layout in android?

From Dev

Android: how to 'insert' a layout into another layout?

From Dev

Toolbar not visible in layout

From Dev

Counting visible elements in a layout

From Dev

Layout below Fragment not visible

From Dev

Why ImageView is NOT VISIBLE in Layout?

Related Related

  1. 1

    Android Linear Layout is not visible

  2. 2

    Invisible Layout not visible when make it visible in Android

  3. 3

    Android layout title bar is not visible

  4. 4

    Android Get height of the visible layout programmatically

  5. 5

    Last cell is not visible in custom Android ListView layout

  6. 6

    Layout not visible in Full Screen Activity in Xamarin Android

  7. 7

    Phonegap - Android How to adjust layout in Full Screen Mode when softkeyboard is visible

  8. 8

    How can I export Layout or Views as images to visible gallery folder in Android?

  9. 9

    how to visible nested layout when click root layout?

  10. 10

    Android: How to set drawable visible

  11. 11

    how to check alert is visible android

  12. 12

    Android: How to set drawable visible

  13. 13

    how to check alert is visible android

  14. 14

    Android Soft Keyboard freezes visible layout until closed

  15. 15

    How to achieve this layout in Android?

  16. 16

    How to Construct this Layout in Android?

  17. 17

    How to create a pagination for dynamically created table layout using set visible?

  18. 18

    How do I layout the body properly with an always-visible sidebar?

  19. 19

    How to keep columns content visible (sticky) in a 3 columns layout?

  20. 20

    How to fix scrolling to a visible cell in UICollectionView with custom layout?

  21. 21

    How to get children of a layout manager that are not yet visible in recyclerview adapter?

  22. 22

    Android: how to sync layout and layout-land

  23. 23

    How to merge Linear Layout and Table Layout at android?

  24. 24

    how to see layout on graphical layout in android?

  25. 25

    Android: how to 'insert' a layout into another layout?

  26. 26

    Toolbar not visible in layout

  27. 27

    Counting visible elements in a layout

  28. 28

    Layout below Fragment not visible

  29. 29

    Why ImageView is NOT VISIBLE in Layout?

HotTag

Archive