Android : Android: Error handling onClickListener

on Friday, August 22, 2014


I have some activity handling the click event on any view



public class MainActivity extends Activity implements OnClickListener{
...
}


I have tried to override via this



public void onClick(View v)
{
switch (v.getId())
{
case R.id.button1:
mp.start();
break;
case R.id.button2:
mp.pause();
break;
case R.id.button3:
mp.stop();
break;
default:
break;
}
}


But it is asking me to change to handle click event via



@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub

}


Has the api's changed , what is the issue I dont have any idea about ?


0 comments:

Post a Comment