Vibrate in dynamic pattern
<p>I'm coming from Actionscript 3 and new to Java. I'm trying to make a vibrate pattern half of which is fixed and half of which is dynamic. For eg:</p>

<pre><code>long[] vibratePattern = {100,100,100,100} //fixed pattern
if(some_condition) vibratePattern.append(400);
if(some_condition) vibratePattern.append(200);
if(some_condition) vibratePattern.append(100);
</code></pre>

<p>But long[] <a href="http://stackoverflow.com/questions/5144549/append-values-dynamically-into-an-long-array">doesn't</a> have any append or add method.</p>

<p>I tied creating ArrayList but the method <a href="http://developer.android.com/reference/android/os/Vibrator.html#vibrate%28long%5B%5D,%20int%29" rel="nofollow">Vibrator.vibrate</a> takes long[] as parameter.</p>

<p>So my question is how can I make long[] array with half fixed item and half dynamic item and pass it to Vibrator.vibrate method. Can I create some other list and pass it as long[] to the method?</p>
