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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:04:22+00:00 2026-05-30T02:04:22+00:00

I have a form which renders, but when I click the submit button, I

  • 0

I have a form which renders, but when I click the submit button, I am not exactly sure how to get the results.

Here is my Activity class:

package com.problemio;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class AddProblemActivity extends Activity 
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.add_problem);


        final EditText problemName = (EditText) findViewById(R.id.problem_name);  
        String name = problemName.getText().toString();  

        final EditText problemText = (EditText) findViewById(R.id.problem_text);  
        String text = problemText.getText().toString();          

   System.out.println(name);     
   System.out.println(text);        




//        Button browseProblemsButton = (Button)findViewById(R.id.browseProblemsButton);   
//        Button searchProblemsButton = (Button)findViewById(R.id.searchProblemsButton);   
 //       Button myProblemsButton = (Button)findViewById(R.id.myProblemsButton);           


    }

    public void sendFeedback(View button) 
    {  


        System.out.println("3");
        Button addProblemButton = (Button)findViewById(R.id.button_send_feedback);   

        addProblemButton.setOnClickListener(new Button.OnClickListener() 
        {  
            public void onClick(View v) 
            {
               System.out.println("4");

              //Intent myIntent = new Intent(ProblemioActivity.this, AddProblem.class);
              //ProblemioActivity.this.startActivity(myIntent);
            }
        });         
        System.out.println("end");

        // Do click handling here  
    }      
}

I put some System.out statements in there to see if anything gets written to my log output, but that didn’t work. I am new to Android dev – is there a commonly used way to output things to the console?

I am also not sure where and how to get the input from the form elements.

Help appreciated,
Alex

  • 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-30T02:04:23+00:00Added an answer on May 30, 2026 at 2:04 am

    Here’s how you get what even the user has input. You actually had all the code you needed in the first place, just not placed correctly. Your listener should look like this and be placed in the onCreate() method (if I’m understanding your intentions correctly):

    Button addProblemButton = (Button)findViewById(R.id.button_send_feedback);
    addProblemButton.setOnClickListener(new Button.OnClickListener()
    {  
       public void onClick(View v) 
       {
          String name = problemName.getText().toString();
          String text = problemText.getText().toString(); 
          sendFeedback(name, text);
        }
    });
    

    Then your sendFeedback function would look like:

    private void sendFeedback(String name, String text){
       //Do what ever you need to here for sending feed back.
    }
    

    As @onit mentioned, you should use the Log class to print out debug information. Specifically Log.d().

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

Sidebar

Related Questions

I have a form which users must fill out and submit. The controller action
I have a form which encapsulates all the functionality, but works with a concrete
I have a form using jquery validation plugin. My submit button has an ajax
I have a form which usually has a hash. I can submit the form
I have a webpage that on a button click grays out the main form
I have a form which is used to insert/display and update . In the
I have a form which takes both the user details and an image uploaded
I have a form which has a lot of SELECTs. For various reasons, I'd
I have a form which I create manually (a lot of JavaScript in it...).
I have a form which has only tab control in it. I want 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.