android-xxxx must implement the inherited abstract method报错

时间:2022-01-07 08:13:37
public class ContactMainFragment extends Fragment implements OnClickListener
{

提示:ContactMainFragment没有实现部分错误

android-xxxx  must implement the inherited abstract method报错

解决方法:可以依提示点击:Add unimplemented methods,添加后如下:

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub }

即可解决,但是onClick具体要实现什么功能还是自己实现;如:

    @Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.show_left_fragment_btn:
mSlidingMenu.showMenu(true);
break;
case R.id.show_right_fragment_btn:
mSlidingMenu.showSecondaryMenu(true);
break;
case R.id.ivTitleName:
if (isConnected())
showStatusQuickAction(v);
break;
default:
break;
}
}