title: Extends class Application in Android?
body: <p>Should I apply permission at runtime inside class Application? 
  Ex: Inside class extends Application I wrote some code instead of I wrote on another class:</p>
  
  <pre><code>if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M) {
          if (ContextCompat.checkSelfPermission(PhotoActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE)
                  != PackageManager.PERMISSION_GRANTED &amp;&amp;
                  ContextCompat.checkSelfPermission(PhotoActivity.this,
                          Manifest.permission.WRITE_EXTERNAL_STORAGE)
                          != PackageManager.PERMISSION_GRANTED &amp;&amp;
                  ContextCompat.checkSelfPermission(PhotoActivity.this,
                          Manifest.permission.CAMERA)
                          != PackageManager.PERMISSION_GRANTED) {
  
              // No explanation needed, we can request the permission.
  
              ActivityCompat.requestPermissions(PhotoActivity.this,
                      new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE,
                              Manifest.permission.CAMERA},
                      Constants.MY_PERMISSIONS_REQUEST_ACCESS_STORAGE);
          }
      }
  </code></pre>
  
  <p>P/s: Sorry for my English :( </p>