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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:04:04+00:00 2026-06-09T00:04:04+00:00

In my application I have to display some 3 edittext views and 3 tex

  • 0

In my application I have to display some 3 edittext views and 3 tex tviews ,Based on some conditions(i.e) if it satisfies some conditions this should display,otherwise it should not.I have this textviews in xml file.How can i achieve this..Thanks in advance:

My xml file:

<?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" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Item" 
        android:layout_marginLeft="10dp"/>

    <EditText
        android:id="@+id/itemedit"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" >

        <requestFocus />
    </EditText>

    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Price" 
        android:layout_marginLeft="10dp"/>

    <EditText
        android:id="@+id/priceedit"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" 
        android:numeric="decimal"/>

    <LinearLayout                                   
          android:orientation="horizontal"          
         android:layout_width="fill_parent"
         android:layout_height="wrap_content">

           <TextView                             -------->TExtview1

        android:layout_width="wrap_content"
        android:layout_height="wrap_content"       
        android:text="Type" 
        android:layout_marginLeft="10dp"/>        
             <TextView                              --------->TExtview2

        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"       
        android:gravity="center_horizontal"  
        android:text="Recurrence" 
       />        

             <TextView                               --------->TExtview3
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="right"       
        android:text="Start Date" 
       />        

         </LinearLayout>

      <LinearLayout 
         android:orientation="horizontal" 
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         >

        <EditText                                     --------->edittext1
        android:id="@+id/recccatedit"
        android:layout_width="110dp"
        android:layout_height="wrap_content"  

        />

        <EditText                                       --------->edittext2
        android:id="@+id/reccedit"
        android:layout_width="80dp"
        android:layout_height="wrap_content" 

        android:numeric="decimal"
        />

    <EditText                                             --------->edittext1
        android:id="@+id/reccdateedit"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" 
        android:layout_weight="1"   
        android:layout_gravity="right"
/>
    </LinearLayout>


            <LinearLayout 
         android:orientation="horizontal" 
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:layout_marginTop="10dp">

                <Button
        android:id="@+id/button2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="Back" />

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="Save" />

    <Button
        android:id="@+id/btndelete"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="Delete" />


      </LinearLayout>

</LinearLayout>

My java class file:

if(!reccinc.equals("0"))
            {
                System.out.println("Inside if");
            EditText rec=(EditText)findViewById(R.id.reccedit);
            EditText reccdate=(EditText)findViewById(R.id.reccdateedit);
            EditText recctype=(EditText)findViewById(R.id.recccatedit);

            String recc=null;
            String date=null;
            String type=null;
            db.open();               
            if(!intent.getStringExtra("Recc").equals("0"))
            {
                 Cursor c= db.getReccurenceCount(intent.getStringExtra("Recc"));    
                 startManagingCursor(c);
                 recc=c.getString(c.getColumnIndex("increment"));
                 date=c.getString(c.getColumnIndex("startdate"));
                 type=c.getString(c.getColumnIndex("recurrencetype"));
            }

            rec.setText(recc);
            recctype.setText(type);
            reccdate.setText(date);
            }
  • 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-09T00:04:06+00:00Added an answer on June 9, 2026 at 12:04 am

    You can call

    view.setVisibility(View.GONE);
    

    to make a view disappear from a layout. You can call

    view.setVisibility(View.VISIBLE);
    

    to bring it back again (assuming it has not been removed from the layout).

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

Sidebar

Related Questions

I have to develop an application that display some information about the possessor of
Hey guys, I have an application that I want to display some data from
I have an asp.net web application using the ReportViewer2008-SP1 controls to display some reports
In my application I have a custom dialog which display some unwanted margin at
I am developing an android application using google maps. I have to display some
We have a winform application that needs to display some results calculated on the
I have to display some math equations in Java application. I've downloaded jEuclid, but
I have a Silverlight application in which I display some phone numbers. I want
I have created a simple silverlight application to display some text at realtime from
In my application I want to display some pictures (I need to have them

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.