主活动布局更新,活动不启动



当我按下plbutton1时,我不接受结果
当我按下plbutton2时,活动R.layout.paraggeleia打开corect
有人能帮我吗
我哪里做错了?这是我的密码!!!!

    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        Bundle args = getArguments();
        switch (args.getInt(ARG_SECTION_NUMBER)){
        case 1: 
            View v = inflater.inflate(R.layout.paraggeleia, container, false);
            Button bTutorial = (Button) v.findViewById(R.id.plbutton2);
            bTutorial.setOnClickListener(new View.OnClickListener(){
                 public void onClick(View v){
                  getActivity().startActivity(new Intent (getActivity(), parageleiaproionta.class));
                  Toast.makeText(v.getContext(), "Loaging Προιόντα", Toast.LENGTH_SHORT).show();
                 }
             });
     return v;
        case 2:
            View m =  inflater.inflate(R.layout.paraggeleia, container, false);
             Button b1Tutorial = (Button) m.findViewById(R.id.plbutton1);
            b1Tutorial.setOnClickListener(new View.OnClickListener(){
                  public void onClick(View m){
                   getActivity().startActivity(new Intent (getActivity(), sxetika.class));
                   Toast.makeText(m.getContext(), "Loaging Προιόντα", Toast.LENGTH_SHORT).show();
                  }
              });
      return m;
    }
        return getView();
}

    }

可能是因为您有开关,只会处理第二条语句。

相关内容

  • 没有找到相关文章

最新更新