简体   繁体   English

如何在Android上管理四个微调器?

[英]How can I manage four spinners on Android?

I have four spinners on Android. 我在Android上有四个微调器。

The better way to explain the work of the spinners is this site . 解释旋转器工作的更好的方法是这个网站

On the left side of the browser, there are four dropdown menus and I want the same build implemented on an Android app, but when one spinner changes it's affecting the other! 在浏览器的左侧,有四个下拉菜单,我想在Android应用程序上实现相同的构建,但是当一个微调器更改时,会影响另一个!

spSura.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() 
{
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) 
{
  browse.changeSura();
}
public void onNothingSelected(AdapterView<?> parent) {}

The code above is part of my code and it shows which listener I use. 上面的代码是我的代码的一部分,它显示了我使用的侦听器。

Your question is not clear for me it's better if you share the full code of the problem. 对我来说,您的问题尚不清楚,如果您共享问题的完整代码,则更好。 I think you're not able to differentiate between the spinners so add individual id's for each spinner and try to track the change on each of them and give different action as follows 我认为您无法区分微调器,因此请为每个微调器添加单独的ID,并尝试跟踪每个微调器的更改并采取以下不同的措施

  if(view.getId()){
     case R.id.spinners_1:
      // change spinners 1
         break;
     case case R.id.spinners_2:
       // change spinners 2
          break;
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM