mirror of https://github.com/tasks/tasks
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
871 B
Java
35 lines
871 B
Java
package org.tasks.injection;
|
|
|
|
import android.os.Bundle;
|
|
import android.support.v7.app.AppCompatActivity;
|
|
|
|
import org.tasks.analytics.Tracker;
|
|
|
|
import javax.inject.Inject;
|
|
|
|
public abstract class InjectingAppCompatActivity extends AppCompatActivity implements InjectingActivity {
|
|
private ActivityComponent activityComponent;
|
|
|
|
@Inject Tracker tracker;
|
|
|
|
@Override
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
activityComponent = ((InjectingApplication) getApplication()).getComponent().plus(new ActivityModule(this));
|
|
inject(activityComponent);
|
|
|
|
super.onCreate(savedInstanceState);
|
|
}
|
|
|
|
@Override
|
|
protected void onResume() {
|
|
super.onResume();
|
|
|
|
tracker.showScreen(getClass().getSimpleName());
|
|
}
|
|
|
|
@Override
|
|
public ActivityComponent getComponent() {
|
|
return activityComponent;
|
|
}
|
|
}
|