The method setOnKeyListener(View.OnKeyListener) in the type View is not applicable for the argum
2014-01-03 11:42
543 查看
最近做popupwindow menu键的功能,给popupwindow的子view加监听出现如下错误:
listView.setFocusableInTouchMode(true);
listView.setOnKeyListener(new OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
// TODO Auto-generated method stub
if ((keyCode == KeyEvent.KEYCODE_MENU)&&(mPopupwindows.isShowing())) {
mPopupWindow.dismiss();
return true;
}
return false;
}
});
报错:The method setOnKeyListener(View.OnKeyListener) in the type View is not applicable for the argum
解决办法:listView.setOnKeyListener(new TextView.OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
// TODO Auto-generated method stub
if ((keyCode == KeyEvent.KEYCODE_MENU)&&(mPopupwindows.isShowing())) {
mPopupWindow.dismiss();
return true;
}
return false;
}
});
listView.setFocusableInTouchMode(true);
listView.setOnKeyListener(new OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
// TODO Auto-generated method stub
if ((keyCode == KeyEvent.KEYCODE_MENU)&&(mPopupwindows.isShowing())) {
mPopupWindow.dismiss();
return true;
}
return false;
}
});
报错:The method setOnKeyListener(View.OnKeyListener) in the type View is not applicable for the argum
解决办法:listView.setOnKeyListener(new TextView.OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
// TODO Auto-generated method stub
if ((keyCode == KeyEvent.KEYCODE_MENU)&&(mPopupwindows.isShowing())) {
mPopupWindow.dismiss();
return true;
}
return false;
}
});
相关文章推荐
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argum
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argum
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argum
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argum
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argum
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argum
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argu
- 报错 The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the ar
- 报错:The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the ar
- 关于The method setMapperClass(Class<? extends Mapper>) in the type Job is not applicable for the argum
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable
- The method setPositiveButton(int, DialogInterface.OnClickListener) in the type AlertDialog.Builder is not applicable for the arguments
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable
- The method setBackground(Drawable) in the type View is not applicable for the arguments (int)
- The method setButton(int, CharSequence, Message) in the type AlertDialog is not applicable for the a
- The method setItems(String) in the type ForTokensTag is not applicable for the arguments (Object)
- 错误:The method replace(int, Fragment) in the type FragmentTransaction is not applicable for the argum
- 解决-The method setOnClickListener(View.OnClickListener) in the type View is not 错误
- The method setOnClickListener(View.OnClickListener) in the type View is not
- 力所能及之The method setOnClickListener(View.OnClickListener) in the type View is not