title: How to convert List<String> to String array
body: <p>I was trying to convert <code>List&lt;String&gt;</code> to <code>String[] allAim= new String[25];</code> i.e. into <code>allAim</code> string array,<br>
  code snippet is:  </p>
  
  <pre><code>List&lt;String&gt; myString = new ArrayList&lt;String&gt;();
  myString=db.getAllAlarmAim();
  Object[] mStringArray = myString.toArray();
  for(int i = 0; i &lt; mStringArray.length ; i++) {
      Log.d("string is",(String)mStringArray[i]);
      allAim[i]=(String)mStringArray[i].toString(); 
  }
  </code></pre>
  
  <p>but when I try to access <code>allAim</code>, the app crashes</p>