获取对话框上点击链接时, [英] Getting dialog when click on button

查看:158
本文介绍了获取对话框上点击链接时,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我,如何让一个对话框弹出( Col​​orPickerDialog )当我在按钮的点击。

Can anybody tell me, how to get a dialog popup (ColorPickerDialog) when i click on Button.

从评论code:

  Button color = (Button)findViewById(R.id.color_button);
    color.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            new ColorPickerDialog(getBaseContext(), mListener ,a ).show();
            System.out.println("button pressed");
        }
    });

   }),initialColor);
   dlg.show();

}
});

} });

我要选择颜色,我使用的名称与微调完成。但我想更多的颜色对,我有拾色器对话框时,I $该按钮我希望它会弹出看到图像P $ PSS:的 http://dl.dropbox.com/u/38493970/device-2011-08-23-134910.png

I want select color , i done with spinner by using names. but i want more color's for that i have color picker dialog when i press on that button i want it will popup see in image: http://dl.dropbox.com/u/38493970/device-2011-08-23-134910.png

推荐答案

您可以用这个的 HTTP://$c$c.google.com/p/color-picker-view/
结果
编辑:
结果

You can use this one http://code.google.com/p/color-picker-view/

button.setOnClickListener(new OnClickListener() {

 void onClick(View v) {
    // create the color picker dialog and display it.
    ColorPickerDialog dlg = new ColorPickerDialog(v.getContext(),new OnColorChangedListener()     {
          void colorChanged(int color) {
               mSelectedColor = color;
           }

       }),initialColor);
       dlg.show();
   }
});

这篇关于获取对话框上点击链接时,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆