【问题标题】:when i click in button, it's need to go for other activity according to the spinner?当我单击按钮时,是否需要根据微调器进行其他活动?
【发布时间】:2013-07-10 08:41:38
【问题描述】:

这是我的代码。 当我选择 agosto - 2013... 日历控制停止

btok.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {

                    if (texto.equals("Julho - 2013")){
                        Intent myIntent = new Intent(v.getContext(),
                                julho.class);
                        startActivityForResult(myIntent, 0);
                    } else if (texto.equals("Agosto - 2013")){
                    Intent myIntent = new Intent(v.getContext(),
                            agosto.class);
                    startActivityForResult(myIntent, 0);
                    } 
                }

            });

【问题讨论】:

    标签: android button spinner


    【解决方案1】:

    尝试使用 setOnItemClickListener 而不是 onClickListener。

    【讨论】:

      猜你喜欢
      • 2021-02-07
      • 2014-11-11
      • 2012-06-02
      • 1970-01-01
      • 2019-08-09
      • 1970-01-01
      • 2021-07-25
      • 2017-11-21
      • 2012-03-03
      相关资源
      最近更新 更多