title: How to manage back button Activity in Android Kotlin
body: <p>I want to manage back button Activity with noHistory.</p>
  
  <p>I add Two different Layout XML add With condition like this : </p>
  
  <pre><code>if(a == 0){attch onexml} if(a == 1){attch secondxml}  
  </code></pre>
  
  <p>when i reach secondxml from onexml , press back button its going to MainActivity , But i want to going onexml.and i used this type of code : </p>
  
  <pre><code>setSupportActionBar(cat_toolbar)
  cat_toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp)
  cat_toolbar.setNavigationOnClickListener { 
  startActivity(Intent(applicationContext, MainActivity::class.java))}
  </code></pre>
  
  <p>i attach two different activity_xml in single Activity using if condition . my App flow is </p>
  
  <pre><code>MainActivity -&gt; (if(a == 0)onexml) 
                  if(a == 1)secondxml). 
  </code></pre>
  
  <p>Start app with MainActicity then click on button goto WorkActivity but first view onexml . again click button of onexml going to secondxml. when i press backbutton of toolbar , it going to MainActivity but i want to goto first onexml and then press back for MainActivity. </p>