在Android开发中继承Dialog类后,如何为该继承类中的Button添加监听事件(鼠标点击)
is_ok_button.setOnLongClickListener(newOkButtonListener());is_quit_button.setOnLongCl...
is_ok_button.setOnLongClickListener(new OkButtonListener() );
is_quit_button.setOnLongClickListener(new QuitButtonListener() );
}
class OkButtonListener implements OnLongClickListener{
@Override
public boolean onLongClick(View v) {
// TODO Auto-generated method stub
title_model_dialog.setText(R.string.modeldialog);
return false;
}
}
class QuitButtonListener implements OnLongClickListener{
@Override
public boolean onLongClick(View v) {
// TODO Auto-generated method stub
title_model_dialog.setText(R.string.modeldialog);
return false;
}
}
} 展开
is_quit_button.setOnLongClickListener(new QuitButtonListener() );
}
class OkButtonListener implements OnLongClickListener{
@Override
public boolean onLongClick(View v) {
// TODO Auto-generated method stub
title_model_dialog.setText(R.string.modeldialog);
return false;
}
}
class QuitButtonListener implements OnLongClickListener{
@Override
public boolean onLongClick(View v) {
// TODO Auto-generated method stub
title_model_dialog.setText(R.string.modeldialog);
return false;
}
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询