android.widget.Spinner.post()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(147)

本文整理了Java中android.widget.Spinner.post()方法的一些代码示例,展示了Spinner.post()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Spinner.post()方法的具体详情如下:
包路径:android.widget.Spinner
类名称:Spinner
方法名:post

Spinner.post介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

private void setSpinnerSelectionWithoutCallingListener(final Spinner spinner, final int selection) {
  final OnItemSelectedListener l = spinner.getOnItemSelectedListener();
  spinner.setOnItemSelectedListener(null);
  spinner.post(new Runnable() {
    @Override
    public void run() {
      spinner.setSelection(selection);
      spinner.post(new Runnable() {
        @Override
        public void run() {
          spinner.setOnItemSelectedListener(l);
        }
      });
    }
  });
}

代码示例来源:origin: limboemu/limbo

private void setCPU(final String cpu) {
  this.mCPU.post(new Runnable() {
    public void run() {
      if (cpu != null) {
        int pos = ((ArrayAdapter<String>) mCPU.getAdapter()).getPosition(cpu);
        mCPU.setSelection(pos);
      }
    }
  });
}

代码示例来源:origin: limboemu/limbo

private void setRAM(final int ram) {
  this.mRamSize.post(new Runnable() {
    public void run() {
      if (ram != 0) {
        int pos = ((ArrayAdapter<String>) mRamSize.getAdapter()).getPosition(ram + "");
        mRamSize.setSelection(pos);
      }
    }
  });
}

代码示例来源:origin: limboemu/limbo

private void setCPUNum(final int cpuNum) {
  this.mCPUNum.post(new Runnable() {
    public void run() {
      if (cpuNum != 0) {
        int pos = ((ArrayAdapter<String>) mCPUNum.getAdapter()).getPosition(cpuNum + "");
        mCPUNum.setSelection(pos);
      }
    }
  });
}

代码示例来源:origin: limboemu/limbo

private void setAdapter(final Spinner spinner, final String value) {
  spinner.post(new Runnable() {
    public void run() {
      if (value != null) {
        int pos = ((ArrayAdapter<String>) spinner.getAdapter()).getPosition(value);
        spinner.setSelection(pos);
      }
    }
  });
}

代码示例来源:origin: limboemu/limbo

private void setDiskAdapter(final Spinner spinner, final String value) {
  spinner.post(new Runnable() {
    public void run() {
      if (value != null) {
        int pos = ((ArrayAdapter<String>) spinner.getAdapter()).getPosition(value);
        if (pos >= 0) {
          spinner.setSelection(pos);
        } else {
          spinner.setSelection(0);
        }
      } else {
        spinner.setSelection(0);
      }
    }
  });
}

代码示例来源:origin: limboemu/limbo

private void setBootDevice(final String bootDevice) {
  this.mBootDevices.post(new Runnable() {
    public void run() {
      if (bootDevice != null) {
        int pos = ((ArrayAdapter<String>) mBootDevices.getAdapter()).getPosition(bootDevice);
        if (pos >= 0) {
          mBootDevices.setSelection(pos);
        } else {
          mBootDevices.setSelection(0);
        }
      } else {
        mBootDevices.setSelection(0);
      }
    }
  });
}

代码示例来源:origin: limboemu/limbo

private void setVGA(final String vga) {
  this.mVGAConfig.post(new Runnable() {
    public void run() {
      if (vga != null) {
        int pos = ((ArrayAdapter<String>) mVGAConfig.getAdapter()).getPosition(vga);
        if (pos >= 0) {
          mVGAConfig.setSelection(pos);
        } else {
          mVGAConfig.setSelection(0);
        }
      } else {
        mVGAConfig.setSelection(0);
      }
    }
  });
}

代码示例来源:origin: limboemu/limbo

private void setHDCache(final String hdcache) {
  mHDCacheConfig.post(new Runnable() {
    public void run() {
      if (hdcache != null) {
        int pos = ((ArrayAdapter<String>) mHDCacheConfig.getAdapter()).getPosition(hdcache);
        if (pos >= 0) {
          mHDCacheConfig.setSelection(pos);
        } else {
          mHDCacheConfig.setSelection(0);
        }
      } else {
        mHDCacheConfig.setSelection(0);
      }
    }
  });
}

代码示例来源:origin: limboemu/limbo

private void setSoundcard(final String soundcard) {
  this.mSoundCard.post(new Runnable() {
    public void run() {
      if (soundcard != null) {
        int pos = ((ArrayAdapter<String>) mSoundCard.getAdapter()).getPosition(soundcard);
        if (pos >= 0) {
          mSoundCard.setSelection(pos);
        } else {
          mSoundCard.setSelection(0);
        }
      } else {
        mSoundCard.setSelection(0);
      }
    }
  });
}

代码示例来源:origin: limboemu/limbo

private void setUI(final String ui) {
  this.mUI.post(new Runnable() {
    public void run() {
      if (ui != null) {
        int pos = ((ArrayAdapter<String>) mUI.getAdapter()).getPosition(ui);
        if (pos >= 0) {
          mUI.setSelection(pos);
        } else {
          mUI.setSelection(0);
        }
      } else {
        mUI.setSelection(0);
      }
    }
  });
}

代码示例来源:origin: limboemu/limbo

private void setNicDevice(final String nic) {
  this.mNicCard.post(new Runnable() {
    public void run() {
      if (nic != null) {
        int pos = ((ArrayAdapter<String>) mNicCard.getAdapter()).getPosition(nic);
        if (pos >= 0) {
          mNicCard.setSelection(pos);
        } else {
          mNicCard.setSelection(3);
        }
      } else {
        mNicCard.setSelection(3);
      }
    }
  });
}

代码示例来源:origin: limboemu/limbo

private void setNetCfg(final String net, boolean userPressed) {
//        this.userPressedNetCfg = userPressed;

    this.mNetConfig.post(new Runnable() {
      public void run() {
        if (net != null) {
          int pos = ((ArrayAdapter<String>) mNetConfig.getAdapter()).getPosition(net);

          if (pos >= 0) {
            mNetConfig.setSelection(pos);
          } else {
            mNetConfig.setSelection(0);
          }
        } else {
          mNetConfig.setSelection(0);

        }
      }
    });

  }

代码示例来源:origin: limboemu/limbo

private void setKeyboard(final String keyboard) {
  this.mKeyboard.post(new Runnable() {
    public void run() {
      if (keyboard!= null) {
        String mouseStr = keyboard;
        int pos = ((ArrayAdapter<String>) mKeyboard.getAdapter()).getPosition(keyboard);
        if (pos >= 0) {
          mKeyboard.setSelection(pos);
        } else {
          mKeyboard.setSelection(0);
        }
      } else {
        mKeyboard.setSelection(0);
      }
    }
  });
}

代码示例来源:origin: limboemu/limbo

private void setSnapshot(final String snapshot) {
  this.mSnapshot.post(new Runnable() {
    public void run() {
      if (snapshot != null && !snapshot.equals("")) {
        int pos = ((ArrayAdapter<String>) mSnapshot.getAdapter()).getPosition(snapshot);
        if (pos >= 0) {
          mSnapshot.setSelection(pos);
          mSnapshot.invalidate();
        } else {
          mSnapshot.setSelection(0);
        }
      } else {
        mSnapshot.setSelection(0);
      }
    }
  });
}

代码示例来源:origin: limboemu/limbo

private void setMouse(final String mouse) {
  this.mMouse.post(new Runnable() {
    public void run() {
      if (mouse!= null) {
        String mouseStr = mouse;
        if(mouseStr.startsWith("usb-tablet"))
          mouseStr+= fixMouseDescr;
        int pos = ((ArrayAdapter<String>) mMouse.getAdapter()).getPosition(mouseStr);
        if (pos >= 0) {
          mMouse.setSelection(pos);
        } else {
          mMouse.setSelection(0);
        }
      } else {
        mMouse.setSelection(0);
      }
    }
  });
}

代码示例来源:origin: offensive-security/nethunter-app

public void run() {
    exe.RunAsRootWithException(finalCommand);
    interfaceSpinner.post(new Runnable() {
      @Override
      public void run() {
        new android.os.Handler().postDelayed(
            new Runnable() {
              public void run() {
                nh.showMessage("Refreshing the current MAC.");
                refreshMAc();
              }
            }, 1000);
      }
    });
  }
}).start();

代码示例来源:origin: stackoverflow.com

spinner.post(new Runnable() {

代码示例来源:origin: oliexdev/openScale

spinUser.post(new Runnable() {
  public void run() {
    spinUser.setOnItemSelectedListener(new spinUserSelectionListener());

代码示例来源:origin: tomahawk-player/tomahawk-android

mEqualizerPresets.post(new Runnable() {
  @Override
  public void run() {

相关文章