- 博客(0)
- 资源 (4)
空空如也
Android实验4
public int compare_130(int a,int b)
{
int c;
c=a>=b?a:b;
return c;
}
public void onClick(View v) {
if (service_130 == null) {
labelView.setText("未绑定服务");
return;
}
int a= Math.round(Integer.parseInt(edit1.getText().toString().trim()));
int b= Math.round(Integer.parseInt(edit2.getText().toString().trim()));
// long a = Math.round(Math.random() * 100);
// long b = Math.round(Math.random() * 100);
int result = service_130.compare_130(a,b);
// long result = mathService.Add(a,b);
String msg = String.valueOf(a) + " compare with " + String.valueOf(b)
+ ",the " + String.valueOf(result)+" is bigger";
labelView.setText(msg);
}
});
2015-05-23
Android实验动态生成数
动态生成数的运用
public int compare_130(int a,int b)
{
int c;
c=a>=b?a:b;
return c;
}
public void onClick(View v) {
if (service_130 == null) {
labelView.setText("未绑定服务");
return;
}
int a= Math.round(Integer.parseInt(edit1.getText().toString().trim()));
int b= Math.round(Integer.parseInt(edit2.getText().toString().trim()));
// long a = Math.round(Math.random() * 100);
// long b = Math.round(Math.random() * 100);
int result = service_130.compare_130(a,b);
// long result = mathService.Add(a,b);
String msg = String.valueOf(a) + " compare with " + String.valueOf(b)
+ ",the " + String.valueOf(result)+" is bigger";
labelView.setText(msg);
}
});
2015-05-23
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人