title: Android: Killing an activity
body: <p>I have an activity where a user put his nickname. I want to not be able to go back after this. I have tried everything but no luck. Tried so far :</p>
  
  <p><strong>Manifest</strong></p>
  
  <pre><code> &lt;activity
       android:name=".NewUserActivity"
       android:noHistory="true" /&gt;
   &lt;activity android:name=".PvP.PVPWinningActivity" /&gt;
  </code></pre>
  
  <p><strong>In Activity:</strong></p>
  
  <pre><code>btnEnterDungeons.setOnClickListener(new View.OnClickListener() {          
       @Override
       public void onClick(View view) {           
          if(!TextUtils.isEmpty(editUsername.getText().toString().trim())) {
               uploadUserData();
               Intent intent = new Intent();
               intent.setClass(NewUserActivity.this, GameChooseActivity.class);
               intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
               startActivity(intent);
               finish();
   }
  </code></pre>
  
  <p>or in Activity again:</p>
  
  <pre><code>btnEnterDungeons.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
           if(!TextUtils.isEmpty(editUsername.getText().toString().trim())) {
               uploadUserData();
               Intent intent = new Intent();
               intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
               intent.setClass(NewUserActivity.this, GameChooseActivity.class);                    
               startActivity(intent);
               finish();
   }
  </code></pre>
  
  <p>None of these works. Actually, I want to completely kill the activity, no back button or any way to have access again.</p>