2024年4月3日发(作者:)

package dialog;

import Interface;

import ialog;

import patActivity;

import ;

import ;

import ;

import xt;

public class MainActivity extends AppCompatActivity {

private Button button;

private EditText year;

@Override

protected void onCreate(Bundle savedInstanceState) {

te(savedInstanceState);

setContentView(ty_main);

button = (Button) findViewById();

year = (EditText) findViewById();

lickListener(new kListener() {

@Override

public void onClick(View v) {

String str = t().toString();

int year = nt(str);

isRunnian(year);

}

});

}

private void isRunnian(int s) {

if ((s % 4 == 0 && s % 400 != 0) || (s % 400 == 0)) {

r builder = new

r();

le("欧耶(^o^)");

sage(s + "年" + "是闰年^-^");

itiveButton("继续输入", new

kListener() {

@Override

public void onClick(DialogInterface dialog, int which) {

t("");

}

});

AlertDialog dialog = ();

();

} else {

r builder = new

r();

le("哎呀呀");

sage(s + "年" + "不是闰年!!!");

itiveButton("继续输入", new

kListener() {

@Override

public void onClick(DialogInterface dialog, int which) {

t("");

}

});

AlertDialog dialog = ();

();

}

}

}