title: dynamically populating data in charsequence
body: <p>I have a charsequence in which I want to populate data dynamically. when I am hard coding the values its working fine, otherwise not</p>
  
  <p><strong>This one is working</strong></p>
  
  <pre><code>private void getDir(String dirPath){
  
       File f = new File(dirPath);
       File[] files = f.listFiles(); 
           final CharSequence[] items = {files[0].getPath(), files[1].getPath()};
  }
  </code></pre>
  
  <p><strong>This one is giving a runtime exception</strong></p>
  
  <pre><code>private void getDir(String dirPath){
  
       File f = new File(dirPath);
       File[] files = f.listFiles(); 
           CharSequence[] items;
           items[0]=files[0].getPath();
       items[1]=files[1].getPath();
  }
  </code></pre>
  
  <p>Please help.         </p>