jeudi 5 novembre 2015

PerformClick does not work correctly

Vote count: 0

I am trying to make a dialog like a tooltip using EasyDialog.

When I show this dialog open with clicking button, everything works fine.

But the problem is when I want to show this dialog at start of the activity.

I tried to show dialog by using button.performClick(). I put toast to make sure that the onClickListener is calling. The result was that, The toast are shoeing normally but the dialog does not.

When I debug the program, I see that these lines of code are executing but I can't understand why the dialog does not display.

Note that the library I use to show the dialog is Here.

Here is the code :

    btnBottomLeft = (Button) findViewById(;
    btnBottomLeft.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            Toast.makeText(this, "HERE", Toast.LENGTH_LONG).show();
            new EasyDialog(MainActivity.this)
                    .setAnimationTranslationShow(EasyDialog.DIRECTION_X, 300, 400, 0)
                    .setAnimationTranslationShow(EasyDialog.DIRECTION_Y, 300, 400, 0)
                    .setAnimationTranslationDismiss(EasyDialog.DIRECTION_X, 300, 0, 400)
                    .setAnimationTranslationDismiss(EasyDialog.DIRECTION_Y, 300, 0, 400)
                    .setMarginLeftAndRight(24, 24)

So, problem is that, the dialog opens correctly by clicking button.

but btnBottomLeft.performClick() just show the toast, not the dialog.

What should I do to make dialog open??

Can anyoe please help me?? Thanks in advance

asked 3 mins ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at

PerformClick does not work correctly

Aucun commentaire:

Enregistrer un commentaire