80,490
社区成员
发帖
与我相关
我的任务
分享
public class Fragment3 extends Fragment {
private View view;
private Button bt_exit;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment3, container, false);
bt_exit = (Button) view.findViewById(R.id.exit);
bt_exit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bt_exit.setText("fragment中点击了按钮");
Toast.makeText(getActivity(), "应该有反应", Toast.LENGTH_SHORT).show();
}
});
return view ;
}
}