使用Android Studio创建新片段时,它会生成onButtonPressed(Uri)方法,如何将其挂钩到UI事件中,比如点击xml中声明的按钮?这个方法打算如何使用?
// TODO: Rename method, update argument and hook method into UI event
public void onButtonPressed(Uri uri) {
if (mListener != null) {
mListener.onFragmentInteraction(uri);
}
}
Run Code Online (Sandbox Code Playgroud)