Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid Wheel Array Half Working
    text
    copied!<p>i have a four wheel picker with words in each wheel my problem at the moment is that each wheel is pulling in the same words you can see the code below.</p> <p>My question is can someone help me in giving each of the wheels there own arrays of words. In the XML below you can see each wheel has its own ID but i cannot figure out how to use them in the java so each wheel has its own specific array. </p> <pre><code>private void initWheel(int id) { WheelView wheel = getWheel(id); wheel.setViewAdapter(new ArrayWheelAdapter&lt;String&gt;(this, new String[]{"Abc", "Foo", "Bar"})); wheel.setCurrentItem((int)(Math.random() * 10)); wheel.addChangingListener(changedListener); wheel.addScrollingListener(scrolledListener); wheel.setCyclic(true); wheel.setInterpolator(new AnticipateOvershootInterpolator()); } private WheelView getWheel(int id) { return (WheelView) findViewById(id); } </code></pre> <p>My XML is </p> <pre><code> &lt;kankan.wheel.widget.WheelView android:id="@+id/passw_1" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;kankan.wheel.widget.WheelView android:id="@+id/passw_2" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;kankan.wheel.widget.WheelView android:id="@+id/passw_3" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;kankan.wheel.widget.WheelView android:id="@+id/passw_4" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload