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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:53:21+00:00 2026-06-01T03:53:21+00:00

I have implemented an application for modify the xml layout with some properties. I

  • 0

I have implemented an application for modify the xml layout with some properties.
I have designed an xml file at R.layout.main.

I am setting Visibility property from my activity class.When i update main.xml file at run time i would like to get copy of main.xml file with updated property as Visibility as gone

Initially the main.xml file as follows:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

//Here i did not set the android:visibility=”gone”
//I would like to change the above property from activity class

    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Question1" android:textColor="#ffffff"/>

    <CheckBox
        android:id="@+id/questioncheckBox1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>

    <EditText
        android:id="@+id/editTextone"
        android:layout_width="180dip"
        android:layout_height="wrap_content" android:focusable="true">
    </EditText>

    <CheckBox
        android:id="@+id/checkBox1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>

</LinearLayout>
</LinearLayout>

I have implemented my application as follows:

   public class ContentExmpleActivity extends Activity {

LinearLayout l1,l2;
CheckBox c1,c2;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    l1 =((LinearLayout)findViewById(R.id.linearLayout1));
    l2=((LinearLayout)findViewById(R.id.linearLayout2));
    c1=((CheckBox)findViewById(R.id.checkBox1));
    c2=((CheckBox)findViewById(R.id.checkBox2));

    c1.setOnCheckedChangeListener(new OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            l1.setVisibility(View.GONE);
        }
    });

    c2.setOnCheckedChangeListener(new OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            l2.setVisibility(View.GONE);
        }
    });

    ((Button)findViewById(R.id.button1)).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {

            //Implementation for get the modified content xml layout with properties from emulator

        }
    });


}
 }

from the above class i am hidding layout when user check the check box then it is hidding.When user click on save button i would like to get the contentView xml file as android layout xml.i mean copy of the main.xml with modified properties as hiding layout properties.

How can i get copy of main.xml file when the content has modified?

please any body help me…..

  • 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-01T03:53:22+00:00Added an answer on June 1, 2026 at 3:53 am

    Replace

    setContentView(R.layout.main);
    

    by

    View vi = View.inflate(this, R.layout.main, null);
    setContentView(vi);
    

    Now, you have a reference of your modified view and you can assign it where you want.

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

Sidebar

Related Questions

I have implemented Shake Event listener in my application and onShake do some logic.
I have implemented an application with multiple check boxes with multiple layouts.I am invisible
we have implemented a web application in asp.net 4.0 and customer needs us to
I have implemented lucene for my application and it works very well unless you
We have implemented SSO in a .NET web application using Windows Identity Foundation (WIF).
I have implemented a CorePlot graph in my iOS application, however I am unable
I have implemented Google Analytics in my iPhone Application. And I can able to
I have implemented a TTPickerTextField in my application, I would like to limit the
I have implemented the code in Devise call backs in my application controller. First
I have an application with a main JFrame that contains a default list model.

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.