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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:05:26+00:00 2026-05-25T02:05:26+00:00

this is my main .xml file : <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical android:layout_width=fill_parent

  • 0

this is my main .xml file :

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

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"

android:textColor="@color/mbackground1"
android:gravity="center_horizontal"
android:text="@string/decode_label"
android:padding="5dip" 
/>

<TextView
android:id="@+id/mytext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:background="@color/mbackground2" 
android:textColor="@color/mytextcolor" 
android:padding="5dip"
/>


 <TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/continue_label"
android:gravity="center_horizontal"
android:textColor="@color/mytextcolor"
android:padding="5dip"
/>

<Button 
android:id="@+id/webbutton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/web_button"
android:textColor="@color/mytextcolor"
/>

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/continue_label1"
android:gravity="center_horizontal"
android:textColor="@color/mytextcolor"
android:padding="5dip"
/>

<Button 
android:id="@+id/callbutton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/call_button"
android:textColor="@color/mytextcolor"
/>
<TextView

android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/continue_label2"
android:gravity="center_horizontal"
android:textColor="@color/mytextcolor"
android:padding="5dip"
/>

<Button 
android:id="@+id/emailbutton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/sendemail_button"
android:textColor="@color/mytextcolor"
/>

</LinearLayout>

i want that based on output at runtime it should show only one textview and button corresponding to that output. im defining layout in main.xml file and also i am ew in this field.

does any one have any idea.
thanks in advance

  • 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-25T02:05:26+00:00Added an answer on May 25, 2026 at 2:05 am

    I assume you know how to get a reference to the views you defined, for example:

    Button button = (Button)findViewById(R.id.emailbutton)
    

    You will need to define an id to each and every view you want to use in the code, just like you did to the emailbutton:

    android:id="@+id/emailbutton"
    

    In order to set the visibility of a view you call:

    button.setVisibility(View.GONE);
    

    you have the option to set the visibility to INVISIBLE and VISIBLE.
    Then you can play with the visibility as you like.
    The differnece between INVISIBLE and GONE is that GONE removes the view completely from the layout while INVISIBLE “saves” the space this view takes.

    You can see that in the API examples.

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

Sidebar

Related Questions

I have the following main.xml file with a LinearLayout <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android
This is the manifest file <?xml version=1.0 encoding=utf-8?> <manifest xmlns:android=http://schemas.android.com/apk/res/android package=net.learn2develop.SMSMessaging android:versionCode=1 android:versionName=1.0> <uses-sdk
I have a main activity with this layout file: <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android
I have the following (as an example) XML file and XSD. <?xml version=1.0 encoding=utf-8
I am trying to implement this example http://www.javacodegeeks.com/2011/02/android-google-maps-tutorial.html and i have followed exactly all
I have created bg3.9.png image following this tutorial http://developer.android.com/guide/developing/tools/draw9patch.html but when i put it
Code first: '''this is main structure of my program''' from twisted.web import http from
I have a code that looks like this: int main () { fstream file;
Hi Guys i got the android.view.InflateException: Binary XML file line #1: Error inflating class
The situation is like this : Main project A. and a class library B.

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.