问题描述
- android程序监听器的地方有错出错
-
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
P1=(ProgressBar)findViewById(R.id.P1);
P2=(ProgressBar)findViewById(R.id.P2);
button=(Button)findViewById(R.id.button);
button.setOnClickListener(new OnClickListener() {@Override public void onClick(View V) { // TODO Auto-generated method stub if(i==0){ P1.setVisibility(View.VISIBLE);
错误是The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the arguments (new DialogInterface.OnClickListener(){})初学安卓不知道怎么弄,请高手指点下
时间: 2024-10-06 23:14:45