Skip to content

Instantly share code, notes, and snippets.

@marcherdiego
Created April 6, 2017 14:00
Show Gist options
  • Save marcherdiego/002ed1e2cfae18d730052c15fb57abed to your computer and use it in GitHub Desktop.
Save marcherdiego/002ed1e2cfae18d730052c15fb57abed to your computer and use it in GitHub Desktop.
public class MainView {
private final Bus bus;
private WeakReference<AppCompatActivity> activityRef;
public MainView(AppCompatActivityactivity, Bus bus) {
activityRef = new WeakReference<>(activity);
this.bus = bus;
}
@Nullable
public AppCompatActivity getActivity() {
return activityRef.get();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment