In my app i need to store the location to firebase so im using two location classes as application because i need to store location for two different entities
First Application class
public class FirstApplicationClass extends MultiDexApplication implements GoogleApiClient.ConnectionCallbacks,
GoogleApiClient.OnConnectionFailedListener,
LocationListener{
}
Second Application Class
public class SecondApplicationClass extends FirstApplicationClass implements GoogleApiClient.ConnectionCallbacks,
GoogleApiClient.OnConnectionFailedListener,
LocationListener {
}
Below is manifest.xml code
<application
android:name=".location.SecondApplicationClass"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
i need to use this.getApplicationContext(); in both the case, in the second case where i am using the Second application class, i am able to use this.getApplicationContext(); from the specific activity i.e,
mSecondApplicationClass = (SecondApplicationClass) this.getApplicationContext();
and able to store the location. I dont know how to use this.getApplicationContext(); with the First Application Class, i.e,
mFirstApplicationClass = (FirstApplicationClass) this.getApplicationContext();
i am unable to achieve this