小编Yul*_*ima的帖子

Android Studio片段 - onButtonPressed方法

使用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)

android android-fragments android-studio

6
推荐指数
1
解决办法
5839
查看次数