title: How to add includeSubdomains dynamically in network-security-config.xml file Android
body: <p>I wanna add multiple domains in network_security_config.xml file at runtime, how can i achieve that? This is the content of network_security_config.xml.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;network-security-config&gt;
      &lt;domain-config cleartextTrafficPermitted="true"&gt;
          &lt;domain includeSubdomains="true"&gt;api.example.com&lt;/domain&gt;
          &lt;domain includeSubdomains="true"&gt;assets.example.com&lt;/domain&gt;
      &lt;/domain-config&gt;
  
      &lt;base-config cleartextTrafficPermitted="false" /&gt;
  &lt;/network-security-config&gt;
  </code></pre>