title: How to access method from base application?
body: <p>I extended "Application" class and created custom method "doSomething". I used manifest to setup this class as base class for whole application. Now, how I can access this "doSomething" method from MainActivity?</p>
  
  <pre><code>public class App extends Application {
  
      public void something()
      {
          //do nothing
      }
  }
  </code></pre>
  
  <p>Manifest:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest package="com.test"
            xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
      &lt;application
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:name=".App"
          android:theme="@style/AppTheme"&gt;
          &lt;activity android:name=".MainActivity"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN"/&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER"/&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p><strong>EDIT: First, thank you for all answers, but I have to sorry for my input. I forgot to mention, that I would like to access it same way as Override. Why? Because I am going to init something (it takes a few ms) in "App" and only after, I can continue with using those values in MainActivity.</strong></p>
  
  <p>Right now I use "BaseActivity", which init user access to database. But each activity open "new" connection which seem to be waste of time. I need to login to database only once and use this references for all activities. This is why I create method "dataReady" in "BaseActivity", extend "MainActivity" with "BaseActivity" and overwrite method "dataReady" to init adapter and other stuff.</p>
  
  <pre><code>public class BaseActivity extends Activity {
  
      void dataReady()
      {
  
      }
  }
  
  public class MainActivity extends BaseActivity {
  
      @Override
      void dataReady()
      {
  
      }
  }
  </code></pre>