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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:57:00+00:00 2026-06-13T02:57:00+00:00

I have 2 views in my app. A form input and a screen to

  • 0

I have 2 views in my app. A form input and a screen to review the form data and confirm. The user inputs the data on the form submission screen in edittext fields. When the user clicks submit, they are presented with the data they input and a ‘back’ and ‘confirm’ button. I want it so that if the user presses back, they are returned to the form input screen and the data they input should still be in the editText fields.

At the moment, I am using an onClickListener to point to the form submission screen but the forms are all blank. How do I keep the data in them?

This is the onClickListener:

bBack.setOnClickListener(new View.OnClickListener() {
    public void onClick(View v) {
        Intent j = new Intent(FormConfirm.this, FormCreate.class);
            startActivity(j);
        }
    });
  • 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-13T02:57:01+00:00Added an answer on June 13, 2026 at 2:57 am

    As stated you should save the values somehow, for example by using SharedPreferences.

    As an example, when you go from the Input-form Activity to the Submit-form Activity:

    bSubmit.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            Intent j = new Intent(FormCreate.this, FormSubmit.class);
            saveInput();
            startActivity(j);
        }
    });
    

    Where the method saveInput() could look something like:

    private void saveInput() {
        EditText input = (EditText) findViewById(R.id.someId);
        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
        preferences.edit().putString("input",input.getText().toString()).commit();   
    }
    

    And then, when you press back, the back action could simply be something like:

    bBack.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            FormConfirm.this.finish();
        }
    });
    

    That will cause the current activity to exit and your previous activity will be visible. If you want to display the last saved input when the Input-form Activity starts, you can simply do something like this:

    private void loadInput(){
        EditText input = (EditText) findViewById(R.id.someId);
        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
        String savedText = getString("input", "default input text");
        input.setText(savedText);   
    }
    

    and call that method in the onCreate-method in your Input-form Activity.

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

Sidebar

Related Questions

I am working on app which have data entry form which have Some fields
I have a form on a page: <form id=create_event method=post action={% url app.views.create_event course.id
In my app I have a view that is a form that has quite
I have in my app/views/bar/index.html.haml the following %p= render partial: 'foo', collection: @foos the
I have an app that have several views. In one view I would like
I have a JSON template under app/views/Application/movie.json in my Play Framework app. Normally you
In the iPod app, the navigation views have the default status bar style, and
I'm developing a WPF app using MVVM. Most of my views have only xaml
I have an app where I'm trying to recursively load views. So I have
I have an app that has a centre view with two views off to

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.