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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:23:06+00:00 2026-05-29T05:23:06+00:00

In my alertdialog the user enters a comment on a Edittext. When I convert

  • 0

In my alertdialog the user enters a comment on a Edittext. When I convert the Editext to an editable then save the editable, it works. However when I try to concat it with other values into a string, it does not save the editable. When I use .toByte when concating with the string, it saved the bytes. I put a // by where the code is that is not working.
Here is my code.

    LayoutInflater inflater = LayoutInflater.from(this);
        final EditText input = new EditText(this);
        new AlertDialog.Builder(this)
        .setTitle("Comments")
        .setMessage("Enter Comments below")
        .setView(input)
        .setPositiveButton("Enter",  new DialogInterface.OnClickListener() {
            Editable value = input.getText();
            String string= value.toString()+ " "+ parent[groupPosition] + " "

//it does not combined value.toString() to the string.
+ kids[groupPosition][childPosition];

            @Override
            public void onClick(DialogInterface dialog, int which) {
                try {

                    FileOutputStream fos = openFileOutput("repairs",
                            Context.MODE_PRIVATE);

                    fos.write(string.toString().getBytes());

                    fos.close();

                } catch (Exception e) {

                    e.printStackTrace();

                } 
  • 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-29T05:23:07+00:00Added an answer on May 29, 2026 at 5:23 am

    have you tried placing

    Editable value = input.getText();
    String string= value.toString()+ " "+ parent[groupPosition] + " ";
    

    inside your try block? As it’s currently written the value field is obtained when the OnClickListener is initialised and won’t reflect the latest user input.

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

Sidebar

Related Questions

I've been trying to using an AlertDialog to open when the user does not
I want to keep AlertDialog focused until a user presses any of the buttons
I am working with AlertDialog for user login to an application.I have displayed two
Currently when the user opens my app, an AlertDialog opens, asking them if they
I am trying to do some EditText validation and want to use an AlertDialog
I created an AlertDialog to show the user next level challenges when one is
I am using an AlertDialog to pop up and ask the user for some
i have created a alertdialog with two radio buttons in it.when user select an
I'm using a GPS disabled AlertDialog and once the user enables GPS, I move
Created a AlertDialog that is used to prompting the user to enter a keyword.

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.