qq_32851763
qq_32851763
2017-01-25 00:51

android 用fragment里的这个intent,点击按钮无法跳转到下一个活动呢

  • android

public class SponsorGroupActivityFragment extends Fragment {

private Button createNewGroupActivity;

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.sponsor_group_activity_frag,container,false);

    createNewGroupActivity = (Button) view.findViewById(R.id.create_new_group_activity);
    createNewGroupActivity.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent(getActivity(),CreateGroupActivityActivity.class);
            startActivity(intent);
        }
    });

    return view;
}

}

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

3条回答