0

当我按下 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();

}


    }
4

1 回答 1

0

也许是因为你有 switch 并且只会处理第二个语句。

于 2013-02-05T19:43:49.277 回答