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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:46:10+00:00 2026-05-24T13:46:10+00:00

EDIT: Thank you all for your help. I edited my Database class to contain

  • 0

EDIT: Thank you all for your help. I edited my Database class to contain the following

    final EditText firstName = (EditText) findViewById(R.id.editText1);  // First Name
    final EditText middleName = (EditText) findViewById(R.id.editText2);  // Middle Name
    final EditText birthDate = (EditText) findViewById(R.id.editText4);  // Birth Date

    final String firstname = firstName.getText().toString();  // First Name
    final String middlename = middleName.getText().toString();  // Middle Name
    final String birthdate = birthDate.getText().toString();  // Birth Date

    TextView firstNameText = (TextView)findViewById(R.id.firstname);
    TextView middleNameText = (TextView)findViewById(R.id.middlename);
    TextView birthDateText = (TextView)findViewById(R.id.birthdate);

    firstNameText.setText(firstname);
    middleNameText.setText(middlename);
    birthDateText.setText(birthdate);

and my database.xml now shows

 <TableRow
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <TextView
        android:background="#aa0000"            
        android:gravity="center_horizontal"
        android:layout_span="3"
        android:id="@+id/firstname"/>
    <TextView
        android:background="#00aa00"
        android:gravity="center_horizontal" 
        android:layout_span="3"
        android:id="@+id/middlename"/>
    <TextView
        android:background="#0000aa"          
        android:gravity="center_horizontal"
        android:layout_span="3"
        android:id="@+id/birthdate"/>
    </TableRow>

but when I run the emulator and I try to access that screen (by clicking a button from the previous screen) the application crashes? I set up the button correctly using the OnClickListener so I’m fairly sure the button is not the problem

  • 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-24T13:46:10+00:00Added an answer on May 24, 2026 at 1:46 pm

    If you’re having trouble understanding the interface here’s an example you can cut and paste.

    main.xml

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        >
    <TextView  
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="First Name: "
        android:id="@+id/firstLabel"
        android:layout_marginTop="14dip"
        android:layout_marginBottom="14dip"
        />
    <EditText android:layout_height="wrap_content" 
        android:layout_width="wrap_content" 
        android:id="@+id/firstEdit" 
        android:text="John"
        android:layout_toRightOf="@id/firstLabel"
        android:layout_alignParentRight="true"></EditText>
        <TextView  
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="Middle Name: "
        android:id="@+id/middleLabel"
        android:layout_below="@id/firstLabel"
        android:layout_marginTop="14dip"
        android:layout_marginBottom="14dip"/>
    <EditText android:layout_height="wrap_content" 
        android:layout_width="wrap_content" 
        android:id="@+id/middleEdit" 
        android:text="Phillip"
        android:layout_below="@id/firstEdit"
        android:layout_toRightOf="@id/middleLabel"
        android:layout_alignParentRight="true"></EditText>
        <TextView  
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="Last Name: "
        android:id="@+id/lastLabel"
        android:layout_below="@id/middleLabel"
        android:layout_marginTop="14dip"
        android:layout_marginBottom="14dip"
        />
    <EditText android:layout_height="wrap_content" 
        android:layout_width="wrap_content" 
        android:id="@+id/lastEdit" 
        android:text="Doe"
        android:layout_below="@id/middleEdit"
        android:layout_toRightOf="@id/lastLabel"
        android:layout_alignParentRight="true"></EditText>
        <TextView  
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="Birthdate: "
        android:id="@+id/birthLabel"
        android:layout_below="@id/lastLabel"
        android:layout_marginTop="14dip"
        android:layout_marginBottom="14dip"
        />
    <EditText android:layout_height="wrap_content" 
        android:layout_width="wrap_content" 
        android:id="@+id/birthEdit" 
        android:text="08/09/1977"
        android:layout_toRightOf="@id/lastLabel"
        android:layout_below="@id/lastEdit"
        android:layout_alignParentRight="true"></EditText>
    
    
    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentLeft="true"
        android:layout_below="@id/birthEdit">
        <TableRow
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        >
        <TextView
            android:background="#aa0000"            
            android:gravity="center_horizontal"
            android:layout_span="3"
            android:text="something"
            android:id="@+id/firstTable"/>
        <TextView
            android:background="#00aa00"
            android:gravity="center_horizontal" 
            android:layout_span="3"
            android:text="something1"
            android:id="@+id/middleTable"/>
        <TextView
            android:background="#0000aa"          
            android:gravity="center_horizontal"
            android:layout_span="3"
            android:text="something2"
            android:id="@+id/birthTable"/>
        </TableRow>
        </LinearLayout>
        </RelativeLayout>
    

    DatabaseExample.java

    import android.app.Activity;
    import android.os.Bundle;
    import android.widget.EditText;
    import android.widget.TextView;
    
    public class DatabaseExample extends Activity {
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
    
            //Setup edit fields
            EditText firstEdit = (EditText)findViewById(R.id.firstEdit);
            EditText middleEdit = (EditText)findViewById(R.id.middleEdit);
            EditText lastEdit = (EditText)findViewById(R.id.lastEdit);
            EditText birthEdit = (EditText)findViewById(R.id.birthEdit);
    
    
            //Get the text and store in variables
            String firstName = firstEdit.getText().toString();
            String middleName = middleEdit.getText().toString();
            String lastName = lastEdit.getText().toString();
            String birthDate = birthEdit.getText().toString();
    
            //setup the text fields
            TextView firstTable = (TextView)findViewById(R.id.firstTable);
            TextView middleTable = (TextView)findViewById(R.id.middleTable);
            TextView birthTable = (TextView)findViewById(R.id.birthTable);
    
            //change the text fields
            firstTable.setText(firstName);
            middleTable.setText(middleName);
            birthTable.setText(birthDate);
    
    
        }
    }
    

    Once again this would be just the interface for inputting and displaying data. Instead of storing the data in String variables you would use SQLite, SharedPreferences, or write to a file on the SDCard.

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

Sidebar

Related Questions

EDIT2: Thank you all for your help! EDIT: on adding @staticmethod, it works. However
First to thank you all for your great help, I have finally published my
EDIT: I have fixed all but two warnings now, so thank you all for
Firstly, thanks for your help. Here's my situation: I'm trying to edit the code
edit: many thanks for all the answers. Here are the results after applying the
Code as reference: http://jsbin.com/aboca3/2/edit In this example above (thank you SLaks) I am truncating
I am creating a few pictureboxes dynamically, then assigning the following: // class variable
I'm learning ASP.NET MVC (and MVC in general) and all the help online I
Why new()/delete() is slower than malloc()/free()? EDIT: Thanks for the answers so far. Please
What if a user hits my site with http://www.mysite.com/Quote/Edit rather than http://www.mysite.com/Quote/Edit/1000 In other

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.