Android 监听Fragment界面的点击事件

public class MeFragment extends Fragment {
    private Button bt_set;

@Override
    public View onCreateView(LayoutInflater inflater,
            @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = View.inflate(getActivity(), R.layout.fragment_me, null);
        bt_set = (Button)view.findViewById(R.id.button_set_sq_start);
       return view;

}

@Override
    public void onActivityCreated(Bundle savedInstanceState) 
    {
       super.onActivityCreated(savedInstanceState);
 
        bt_set.setOnClickListener(new OnClickListener() {
            
            @Override
            public void onClick(View v) {

//这里添加进行的点击事件

 

          }
        });

}

参考链接:https://blog.csdn.net/u010940300/article/details/43170477?utm_source=blogkpcl3#commentBox 

你可能感兴趣的:(Android)