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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:55:01+00:00 2026-06-17T10:55:01+00:00

I have small query in android. I have one activity in which it has

  • 0

I have small query in android.
I have one activity in which it has 3 buttons and on one button click I am displaying the AlertDialog box and on second button click I am displaying the List Dialog Box and On 3rd button click I am toggle the OnScreen Key board in android.

my problem is that I was able to call the first button and when I click the 2nd and 3rd button they are not responding and also I have checked by inserting breakpoints on respective click event functions, the control flow is not at all going inside the functions. simple it skips the fun and going to the end of the main OnCreate function.

here is the code I have used for the first 2 buttons…

        Button btn=(Button) findViewById(R.id.button1);
    btn.setOnClickListener(new View.OnClickListener()
    {
        @Override
        public void onClick(View v)
        {
            // TODO Auto-generated method stub
            ShowListDialog();
        }
    });

    btn=(Button) findViewById(R.id.btnShowList);
    btn.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            ShowOneDialog();
        }
    });

I am calling the functions ShowOneDialog() and ShowListDialog() functions and hope that functions are not needed
and for the 3rd button click event is here below…

btn=(Button) findViewById(R.id.btnToggle);
btn.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            InputMethodManager inmgr=(InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
            inmgr.toggleSoftInput(0, 0);
        }
    });
  • 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-17T10:55:02+00:00Added an answer on June 17, 2026 at 10:55 am
    Button btn=(Button) findViewById(R.id.button1); 
    

    You have set your btn as button1, and so you’ve only attached a listener to THAT button, which is why your other button isn’t doing anything.

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

Sidebar

Related Questions

Hi i have a small query which takes data from one mysql database and
I have small PHP script which has $query = SELECT MAX(id) FROM `dbs`; //query
i have a small query, Suppose we start an activity using intents startActivity(intent); and
I have a small app which query our SharePoint server' Web Service interface for
I have small query today I happen to see when I typed a website
i have small query as follows: If i will make view state property of
I have small script in bash, which is generating graphs via gnuplot. Everything works
I have a small Android app and currently I am firing a sql statement
I have a small query as below. I have created a shared library from
I have a small query.I just started out with the SWT programming and learnt

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.