title: Check permissions and reload the activity
body: <p>Hi everyone I have a problem with load activity elements after checking runtime permission I made a app for Lollipop but now I need update to Marshmallow so I have this problem</p>
  
  <p>I have a MainActivity</p>
  
  <pre><code>        public static final int REQUEST_ID_MULTIPLE_PERMISSIONS = 1;
  
          @Override
              protected void onCreate(Bundle savedInstanceState) {
                  super.onCreate(savedInstanceState);
  
                  setContentView(R.layout.activity_main);
  
                  if(checkAndRequestPermissions(this)) {
                      //Var created
                      Internetstatus = (TextView) findViewById(R.id.statusInternet);
  
                      if (!verificaConexion(this)) {
                          Internetstatus.setText("NOT CONNECTED");
                      } else {
                          Internetstatus.setText("CONNECTED");
                      }
                  }
              }
  
  
              public static boolean verificaConexion(Context ctx) {
  
                  boolean bConectado = false;
                  ConnectivityManager cm = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE);
                  NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
                  if (activeNetwork != null) {
                          bConectado = true;
                  }
                  return bConectado;
              }
  
  
  
  
          private  boolean checkAndRequestPermissions(Context ctx) {
              if (android.os.Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M) {
                  Toast.makeText(this, "Checking permission…", Toast.LENGTH_SHORT).show ();
                  //List of permissions
                  int permissionInternet = ContextCompat.checkSelfPermission(this,
                          Manifest.permission.INTERNET);
  
                  int permissionAccessNetwork = ContextCompat.checkSelfPermission(this,
                          Manifest.permission.ACCESS_NETWORK_STATE);
  
                  int permissionReadExternal = ContextCompat.checkSelfPermission(this,
                          Manifest.permission.READ_EXTERNAL_STORAGE);
                  int permissionWriteExternal = ContextCompat.checkSelfPermission(this,
                          Manifest.permission.WRITE_EXTERNAL_STORAGE);
  
  
                  List&lt;String&gt; listPermissionsNeeded = new ArrayList&lt;&gt;();
  
                  //Verify status of permissions
                  if (permissionInternet != PackageManager.PERMISSION_GRANTED) {
                      listPermissionsNeeded.add(Manifest.permission.INTERNET);
                  }
                  if (permissionAccessNetwork != PackageManager.PERMISSION_GRANTED) {
                      listPermissionsNeeded.add(Manifest.permission.ACCESS_NETWORK_STATE);
                  }
                  if (permissionReadExternal != PackageManager.PERMISSION_GRANTED) {
                      listPermissionsNeeded.add(Manifest.permission.READ_EXTERNAL_STORAGE);
                  }
                  if (permissionWriteExternal != PackageManager.PERMISSION_GRANTED) {
                      listPermissionsNeeded.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
                  }
  
  
                  if (!listPermissionsNeeded.isEmpty()) {
                      ActivityCompat.requestPermissions(this, listPermissionsNeeded.toArray(new String[listPermissionsNeeded.size()]), REQUEST_ID_MULTIPLE_PERMISSIONS);
                      return false;
                  }
  
  
                  return true;
  
              }
              return true;
          }
  
  
      }
  </code></pre>
  
  <p>Right, I have more elements in the activity but with the only single text is fine for the example :), the checking permission is fine but when I press allow the permissions the activity text status is the default text xD! "Small Text", so the setText not work, but if I close the app and open again all work perfectly because I have allowed the permission yet. Hey is my first time that I make app for marshmallow, so maybe the problem is very stupid hahahha.</p>
  
  <p>Well after that dont work I thought that maybe if I create a new activity LoadActivity I can check the permissions there (move function check and all about check permission from MainActivity to LoadActivity) and if the conditional is fine I initialize the MainActivity, this fine start new activity (LoadActivity), I check permissions but start the MainActivity dont work after I allow permissions</p>
  
  <p>The new LoadActivity is</p>
  
  <pre><code>public class LoadActivity extends AppCompatActivity {
  
      public static final int REQUEST_ID_MULTIPLE_PERMISSIONS = 1;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_load);
  
          if(checkAndRequestPermissions(this)) {
              Intent intent = new Intent(this, MainActivity.class);
              startActivityForResult(intent, 0);
          }
  
  
      }
  
      private  boolean checkAndRequestPermissions(Context ctx) {
          if (android.os.Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M) {
              Toast.makeText(this, "Checking permission…", Toast.LENGTH_SHORT).show ();
              //List of permissions
              int permissionInternet = ContextCompat.checkSelfPermission(this,
                      Manifest.permission.INTERNET);
  
              int permissionAccessNetwork = ContextCompat.checkSelfPermission(this,
                      Manifest.permission.ACCESS_NETWORK_STATE);
  
              int permissionReadExternal = ContextCompat.checkSelfPermission(this,
                      Manifest.permission.READ_EXTERNAL_STORAGE);
              int permissionWriteExternal = ContextCompat.checkSelfPermission(this,
                      Manifest.permission.WRITE_EXTERNAL_STORAGE);
  
  
              List&lt;String&gt; listPermissionsNeeded = new ArrayList&lt;&gt;();
  
              //Verify status of permissions
              if (permissionInternet != PackageManager.PERMISSION_GRANTED) {
                  listPermissionsNeeded.add(Manifest.permission.INTERNET);
              }
              if (permissionAccessNetwork != PackageManager.PERMISSION_GRANTED) {
                  listPermissionsNeeded.add(Manifest.permission.ACCESS_NETWORK_STATE);
              }
              if (permissionReadExternal != PackageManager.PERMISSION_GRANTED) {
                  listPermissionsNeeded.add(Manifest.permission.READ_EXTERNAL_STORAGE);
              }
              if (permissionWriteExternal != PackageManager.PERMISSION_GRANTED) {
                  listPermissionsNeeded.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
              }
  
  
              if (!listPermissionsNeeded.isEmpty()) {
                  ActivityCompat.requestPermissions(this, listPermissionsNeeded.toArray(new String[listPermissionsNeeded.size()]), REQUEST_ID_MULTIPLE_PERMISSIONS);
                  return false;
              }
  
  
              return true;
  
          }
          return true;
      }
  }
  </code></pre>
  
  <p>I hope someone can help me :D
  Regards </p>