I'm wondering if it's possible to use onResume() and onPause() outside the MainActivity. In my android project, I have the typical setup for my main class
package com.my.package
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// blah blah
}
}
I have a second class in the project which extends the MainActivity, but my onResume() and onPause() never run
package com.my.package
public class OtherClass extends MainActivity {
@Override
protected void onResume() {
super.onResume();
// resume code
}
@Override
protected void onPause() {
super.onResume();
// pause code
}
}
Is this possible? Am I doing something wrong? I'm trying to organize my code because my MainActivity file is getting too large. thanks in advance.