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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:51:20+00:00 2026-05-31T10:51:20+00:00

When the user click on textEditor , dialog calculator will display, that time parent

  • 0

When the user click on textEditor , dialog calculator will display, that time parent activity/screen should be disable.

This is my code :

txtQty.setOnFocusChangeListener(new OnFocusChangeListener() {
   public void onFocusChange(View v, boolean hasFocus) {
        if(hasFocus){
                        keyAmount = new StringBuffer();
                        if(keyAmount.length() > 0){
                            keyAmount.delete(0, keyAmount.length());
                        }

                        int[] origin = new int[2];
                        v.getLocationOnScreen(origin);
                        final int xVal = origin[0];
                        final int yVal = origin[1] ;

                        dialog = new Dialog(SalesActivityGroup.group.getParent());
                        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);

                        View vLoad = LayoutInflater.from(SalesActivityGroup.group.getParent()).inflate(R.layout.key_pad, null);
                        dialog.setContentView(vLoad);
                        android.view.WindowManager.LayoutParams lp= dialog.getWindow().getAttributes();  

                        dialog.setCancelable(true);
                        dialog.setCanceledOnTouchOutside(true);  
                        lp.x = xVal;
                        lp.y = yVal;
                        lp.width = LayoutParams.WRAP_CONTENT;
                        lp.height = LayoutParams.WRAP_CONTENT;
                        lp.gravity = Gravity.TOP | Gravity.LEFT;
                        lp.dimAmount = 0;            
                        dialog.getWindow().setAttributes(lp);
                        dialog.setCancelable(true);
                        keyamDisplay  = (TextView)dialog.findViewById(R.id.keyamDisplay);

                        Button  txtone = (Button)dialog.findViewById(R.id.txtone);
                        txtone.setOnClickListener(new OnClickListener() {
                           public void onClick(View v) {
                              keyAmount.append("1");
                              keyamDisplay.setText("" + keyAmount.toString());

                           }
                        });

                        Button  txttwo = (Button)dialog.findViewById(R.id.txttwo);
                        txttwo.setOnClickListener(new OnClickListener() {
                           public void onClick(View v) {
                              keyAmount.append("2");
                              keyamDisplay.setText("" + keyAmount.toString());

                           }
                        });

                        Button  txtthree = (Button)dialog.findViewById(R.id.txtthree);
                        txtthree.setOnClickListener(new OnClickListener() {
                           public void onClick(View v) {
                              keyAmount.append("3");
                              keyamDisplay.setText("" + keyAmount.toString());
                           }
                        });

                        Button  txtfour = (Button)dialog.findViewById(R.id.txtfour);
                        txtfour.setOnClickListener(new OnClickListener() {
                           public void onClick(View v) {
                              keyAmount.append("4");
                              keyamDisplay.setText("" + keyAmount.toString());
                           }
                        });

                        Button  txtfive = (Button)dialog.findViewById(R.id.txtfive);
                        txtfive.setOnClickListener(new OnClickListener() {
                           public void onClick(View v) {
                              keyAmount.append("5");
                              keyamDisplay.setText("" + keyAmount.toString());
                           }
                        });

                        Button  txtsix = (Button)dialog.findViewById(R.id.txtsix);
                        txtsix.setOnClickListener(new OnClickListener() {
                           public void onClick(View v) {
                              keyAmount.append("6");
                              keyamDisplay.setText("" + keyAmount.toString());
                           }
                         });

                        Button  txtseven = (Button)dialog.findViewById(R.id.txtseven);
                        txtseven.setOnClickListener(new OnClickListener() {
                           public void onClick(View v) {
                              keyAmount.append("7");
                              keyamDisplay.setText("" + keyAmount.toString());
                           }
                        });

                        Button  txteight = (Button)dialog.findViewById(R.id.txteight);
                        txteight.setOnClickListener(new OnClickListener() {
                           public void onClick(View v) {
                              keyAmount.append("8");
                              keyamDisplay.setText("" + keyAmount.toString());
                           }
                        });

                        Button  txtnine = (Button)dialog.findViewById(R.id.txtnine);
                        txtnine.setOnClickListener(new OnClickListener() {
                           public void onClick(View v) {
                              keyAmount.append("9");
                              keyamDisplay.setText("" + keyAmount.toString());
                           }
                        });

                        Button  txtZero = (Button)dialog.findViewById(R.id.txtZero);
                        txtZero.setOnClickListener(new OnClickListener() {
                           public void onClick(View v) {
                              keyAmount.append("0");
                              keyamDisplay.setText("" + keyAmount.toString());
                           }
                        });

                        Button  txtdot = (Button)dialog.findViewById(R.id.txtdot);
                        txtdot.setOnClickListener(new OnClickListener() {
                               public void onClick(View v) {
                                  keyAmount.append(".");
                                  keyamDisplay.setText("" + keyAmount.toString());
                               }
                        });

                        Button  diaDelete = (Button)dialog.findViewById(R.id.diaDelete);
                        diaDelete.setOnClickListener(new OnClickListener() {
                           public void onClick(View v) {
                             if(keyAmount.length() > 0){
                                keyAmount.delete(keyAmount.length()-1, keyAmount.length());
                            }
                                keyamDisplay.setText("" + keyAmount.toString());
                           }
                        });

                        ImageButton imageSmileExit = (ImageButton)dialog.findViewById(R.id.imageSmileExit);
                        imageSmileExit.setOnClickListener(new OnClickListener() {
                            public void onClick(View v) {
                                dialog.dismiss();
                            }
                        });

                        Button  txtDialogOK = (Button)dialog.findViewById(R.id.txtDialogOK);
                        txtDialogOK.setOnClickListener(new OnClickListener() {
                           public void onClick(View v) {
                               dialog.dismiss();

This is my screen shot :

enter image description here

  • 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-31T10:51:22+00:00Added an answer on May 31, 2026 at 10:51 am

    I think in your code instead of dialog.setCancelable(true); use dialog.setCancelable(false);
    and within ok or cancel button onclicklistener you have to dismiss or cancel the dialog.

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

Sidebar

Related Questions

When user click the Bing Search button, this will cause Deactivated event. So, I
When The user Click on the button it want to call the dialog- that
User click on a link button and it will direct them to a url
Suppose, I want to have a link or a button that when user click
it happens that the user click on enter where i dont want to include
when user click a another link or refresh the page, the window will unload,
in the application when user click on button to run new activity it have
I mean: user click some print button and printer start printing. Is it that
Once user click toggle full screen mode. i need to add insertimage icon into
The work flow: user click the button, a dialog box opens with a search

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.