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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:42:49+00:00 2026-06-10T07:42:49+00:00

Some Background I have a TableLayout with 9 rows. I chose the TableLayout because

  • 0

Some Background
I have a TableLayout with 9 rows. I chose the TableLayout because I could successfully line up EditText views next to each other on 1 row. I have 6 EditText on two rows as you will see below, but to avoid repetitiveness I am only going to include 2 of the 6 to save on space and I removed some of the unecessary rows because they were displaying properly (just TextView).

The Problem
The problem I am having is after I press the Button on my layout, all of the EditText views disappear. My button initiates contact to a WCF Restful Service, but does so using an AsyncTask. There is a wait dialog to occupy the user and sometimes toast messages pop up. This is all normal behavior. To be perfectly the EditText disappear immediately after I press the button.

I have searched with google and stackoverflow and I have seen similar problems, but not the same problem that I am having. What is very weird is this only happens when I am debugging on my phone, it doesn’t happen in the AVD emulator.

Stats
Phone: T-Mobile myTouchQ LG-C800 (FYI: not the greatest phone) I rooted it.
Phone Android Version: 2.3.4 (LG Doesn’t believe in updates apparently)
IDE: IntelliJ 11.1
Android SDK : 4.0.3
Java Version: 1.7

Questions
1. Should I use a different layout?
2. Any clue why this is happening?

Here is shortened version of my Layout.xml:

<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
             android:id="@+id/tableLayout1"
             android:layout_width="fill_parent"
             android:layout_height="fill_parent" >
    <TableRow android:id="@+id/rowTitleWinningNumbers"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:padding="0dip" >
        <TextView android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Winning Numbers" />
    </TableRow>
    <TableRow android:id="@+id/rowWinningNumbers"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:padding="0dip" >
        <EditText android:id="@+id/txtLotto1"
                  android:inputType="text"
                  android:layout_width="0dp"
                  android:layout_weight="16.67"
                  android:editable="false"
                  android:focusable="false" />
        <EditText android:id="@+id/txtLotto2"
                  android:inputType="text"
                  android:layout_width="0dp"
                  android:layout_weight="16.67"
                  android:editable="false"
                  android:focusable="false" />
    </TableRow>
    <TableRow android:id="@+id/rowTitlePlayerNumbers"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:padding="0dip" >
        <TextView android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Your Numbers" />
    </TableRow>
    <TableRow android:id="@+id/rowPlayerNumbers"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:padding="0dip" >
        <EditText android:id="@+id/txtPlayer1"
                  android:inputType="text"
                  android:layout_width="0dp"
                  android:layout_weight="16.67"
                  android:hint="@string/strDefaultNumber" />
        <EditText android:id="@+id/txtPlayer2"
                  android:inputType="text"
                  android:layout_width="0dp"
                  android:layout_weight="16.67"
                  android:hint="@string/strDefaultNumber" />
    </TableRow>
    <TableRow android:id="@+id/rowPlayerStatus2"
              android:layout_height="wrap_content"
              android:layout_width="wrap_content"
              android:gravity="center">
        <Button android:id="@+id/btnSubmit"
                android:text="Did I Win?!"
                android:onClick="btnSubmit_onClick" />
        <CheckBox android:id="@+id/cbxSavePlayerNumbers"
                  android:layout_height="wrap_content"
                  android:layout_width="wrap_content"
                  android:gravity="center"
                  android:lines="2"
                  android:text="Save my \nNumbers" />
    </TableRow>
</TableLayout>

EDIT The code as requested in the comments

public void btnSubmit_onClick(View v)
{
    try
    {
        clearStatuses();

        setLabelText(R.id.lblTimeStamp, DateTime.Today().toString());

        savePlayerNumbers();

        //This method has to perform its main task asynchronously
        getWinningLotteryNumbers();
    }
    catch(Exception ex)
    {
        ex.toString();
    }
}

private void getWinningLotteryNumbers()
{
    try
    {
        _waitDialog = ProgressDialog.show(MyActivity.this, "Working", "Getting latest Lottery drawing, Please Wait...", true);

        getButton(R.id.btnSubmit).setEnabled(false);

        String strUrl = getRString(R.string.strWCFServiceURL);

        new LottoProxy().execute(strUrl);
    }
    catch (Exception e)
    {
        resetControlStates();
    }
}

private void clearStatuses()
{
    TextView lblStatus = getLabel(R.id.lblStatus);
    lblStatus.setText("");
    lblStatus.setTextColor(Color.BLACK);

    for (int i = 0; i < 6; i++)
        resetTextBoxBackResource(getWinningBox(i), getPlayerBox(i));
}

I am supremely stuck on this, so thank you in advance for your help. This is my first real app (as opposed to just playing around), so if I made a novice mistake please let me know.

  • 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-10T07:42:51+00:00Added an answer on June 10, 2026 at 7:42 am

    So it turns out that the EditText were not disappearing, but were hidden from view because of my clearStatuses() method which iterates through all of the available EditText and changes their backgrounds to Black. This is not the wait to handle this because apparently when doing this you are overwriting the stock EditText background image.

    The mind boggling part is (as I said in my comments above) I commented out all of the code in the onClick() method and this still happened anyhow. Therefore pin pointing the problem was rather difficult and confusing. I wonder if this is a bug in Android?

    I learned to use the following code to change your EditText back to the way it usually looks:

    yourEditText.setBackgroundResource(android.R.drawable.editbox_background_normal);
    

    I found this answer here:
    Removing the background color of an EditText

    A word of warning, even though this code will revert the EditText back to what it looks like, it may not match the original look. I am saying this because that is what I experienced, but it is good enough for me.

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

Sidebar

Related Questions

We have to use delayed_job (or some other background-job processor) to run jobs in
I have different table rows, each of it contains some information text which should
I have a TableLayout inside a ScrollView, because of some special needs, I need
OK, first some background: I have a page showing the number of hits(or views)
Some Background I have an iPhone app with three UIWebViews, each used to show
I have a TableLayout with 3 rows at present and each row has one
Some background: we have a windows application (c#) that locate in the system try.
Some setup background first: I have a cronjob which runs a PHP file called
I have one AlertDialog which is working fine.I have set some background images to
In an android service I have created thread(s) for doing some background task. I

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.