title: Android Data Backup: dynamic file list with BackupAgentHelper
body: <p>I want to backup my internal files. These are created by My App: random number of files and random names. Like data1.xml, data7,xml, data13.xml, ....</p>
  
  <p>So I do not have any fixed file list.</p>
  
  <p>When MyBackupAgentHelper::onCreate is running before the onBackup(), I can easily provide the filenames by querying the files getApplicationContext().fileList();</p>
  
  <pre><code>public class MyBackupAgentHelper extends BackupAgentHelper 
  {
    @Override
    public void onCreate() 
    {
      String[] files  = getApplicationContext().fileList();
      FileBackupHelper helper = new FileBackupHelper(this, files );
      addHelper(FILES_BACKUP_KEY, helper);    
    }
  ...
  </code></pre>
  
  <p>However, if the onRestore is ready to run after an uninstall/re-install, I cannot provide the filenames in the onCreate as this time the getApplicationContext().fileList() returns empty list - obviously.</p>
  
  <p>So nothing is restored :(</p>
  
  <p>Is there any way to restore all files which were backuped without specifying the filenames? Just saying, "do it all".</p>
  
  <p>If not, how could I use the Data Backup in this scenario?</p>
  
  <p>Thanks</p>