小编Bla*_*fix的帖子

Android对话框,按下按钮时保持对话框打开

当我按下按钮时,我想保持对话框打开.目前正在关闭.

AlertDialog.Builder builder = new AlertDialog.Builder(this);

builder.setMessage("Are you sure you want to exit?")

   .setCancelable(false)
   .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
       public void onClick(DialogInterface dialog, int id) {
            MyActivity.this.finish();
       }
   })
   .setNegativeButton("No", new DialogInterface.OnClickListener() {
       public void onClick(DialogInterface dialog, int id) {
            dialog.cancel();
       }
   });
AlertDialog alert = builder.create();
Run Code Online (Sandbox Code Playgroud)

android dialog

62
推荐指数
3
解决办法
6万
查看次数

Android短屏亮度代码!

谁知道为什么这段代码没有降低我的应用程序的背光?

Context context = this;

    Settings.System.putInt(context.getContentResolver(),
    Settings.System.SCREEN_BRIGHTNESS, 255);
Run Code Online (Sandbox Code Playgroud)

settings android

4
推荐指数
1
解决办法
6893
查看次数

C#如何为多个按钮使用一个单击事件处理程序

可能重复:
C#发送按钮点击同一个对象

我的项目中有很多按钮.为了使我更短的程序通过编辑Designer.cs文件并将每次单击指向我的方法,使每次单击按钮都使用相同的"Button_click"方法.

 this.button1.Click += new System.EventHandler(this.Mymethod);
Run Code Online (Sandbox Code Playgroud)

如何识别Mymethod方法中按下的按钮?

谢谢!

c#

1
推荐指数
2
解决办法
3万
查看次数

C#将按钮单击发送到同一个对象

我的项目中有很多按钮.为了使程序更短,需要将按钮的每次单击都设置为相同的"Button_click"方法.这可能吗?

谢谢

c#

0
推荐指数
1
解决办法
1963
查看次数

C#double,十进制问题

为什么这个计算:双数=(13 /(13 + 12 + 13))

等于0?

我认为它应该在0.34左右!

谢谢!

c# integer-division

0
推荐指数
1
解决办法
1995
查看次数

C#插入一个变量

我有这个代码,我有一个arrayList.我使用方法arrayList.Contains.

 if (arrayList2.Contains(5))
 {
     //something
 }
Run Code Online (Sandbox Code Playgroud)

我想在代码中用一个包含值arrayList2的变量(例如一个字符串)替换arrayList2.

string hello = "arrayList2" // create a varible with the value of the name of the arrayList
if (hello.Contains(5)) // insert the variable "hello" instead of "arrayList2"
{
    //something
}
Run Code Online (Sandbox Code Playgroud)

这种方法不起作用,任何想法我怎么能让它工作?

c#

-4
推荐指数
1
解决办法
162
查看次数

标签 统计

c# ×4

android ×2

dialog ×1

integer-division ×1

settings ×1