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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:47:14+00:00 2026-06-09T12:47:14+00:00

I want to make a toast in which I have put EditText and a

  • 0

I want to make a toast in which I have put EditText and a button ..but I can’t type anything inside EditText neither I can click the button how to write inside EditText that viewed by the toast..

public class MainActivity extends Activity 
{
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button New=(Button)findViewById(R.id.button1);
        Button save=(Button)findViewById(R.id.button3);
        EditText ed1=(EditText)findViewById(R.id.editText1);

        final Toast t=new Toast(getApplicationContext());
        New.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {
                // TODO Auto-generated method stub


            ListView l=new ListView(getApplication());
            l.setAdapter(new badp(getApplicationContext()));

            t.setGravity(Gravity.CENTER_VERTICAL, 0, 0);

            t.setView(l);
            t.setDuration(Toast.LENGTH_LONG);
            t.show();
            }
        });


    }
    public class badp extends BaseAdapter
    {

        Context context;
        private badp(Context context) {
            // TODO Auto-generated constructor stub
            this.context=context;
        }

        public int getCount() {
            // TODO Auto-generated method stub
            return 1;
        }

        public Object getItem(int position) {
            // TODO Auto-generated method stub
            return null;
        }

        public long getItemId(int position) {
            // TODO Auto-generated method stub
            return 0;
        }

        public View getView(int position, View convertView, ViewGroup parent) {
            // TODO Auto-generated method stub
            LinearLayout l=new LinearLayout(context);
            Button b1=new Button(context);
            b1.setText("Save");
            EditText ed=new EditText(context);
            ed.setGravity(Gravity.CENTER);
         //   LayoutParams lparams = new LayoutParams();
           //     ed.setLayoutParams(lparams);
                ed.setWidth(5);
                ed.setEms(10);


            l.addView(ed);
            l.addView(b1);

            return l;
        }

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }


}
  • 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-09T12:47:16+00:00Added an answer on June 9, 2026 at 12:47 pm

    You should probably use a Dialog instead of a Toast.

    Dialog is designed for more interactive pop-ups, where-as a toast is really designed to display a quick text message.

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

Sidebar

Related Questions

I have an alert dialog which is invoked when the user click back button
I want make a bash script which returns the position of an element from
I want make interactive application where user launches it and can do various task
I have style sheet with a class name changebackgroundcolor i want make change in
I have link for example domain.com/de/controler/action?param=value and I want make actionlink to keep same
I have uploaded a app in production mode to linode. I want make changes
I have a custom toast notification which has an image and text. The custom
I used Toast to make notification, but it seems it will appear even its
I want to make a homescreen-widget which displays a random Receipt from a database.
I want to make a toast where it shows Your message message is sent

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.