Permalink
Browse files

Inner loop - Green: Implement show account statement

Set up service locator instance
  • Loading branch information...
1 parent 8520fbb commit fcb4030f88150ac718f95a3ebb1740b24c55c9af @CarlosMChica committed May 2, 2016
@@ -5,6 +5,7 @@
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
+import me.panavtec.androidbankkata.account.BankAccount;
import me.panavtec.androidbankkata.account.statement.StatementView;
public class ShowStatementActivity extends AppCompatActivity implements StatementView {
@@ -14,6 +15,9 @@
@Override protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initView();
+ BankAccount account = ShowStatementActivityServiceLocator.getInstance().getAccount();
+ account.attach(this);
+ account.showStatement();
}
private void initView() {
@@ -4,11 +4,17 @@
class ShowStatementActivityServiceLocator {
+ private static ShowStatementActivityServiceLocator instance;
+
public static ShowStatementActivityServiceLocator getInstance() {
- return null;
+ if (instance == null) {
+ instance = new ShowStatementActivityServiceLocator();
+ }
+ return instance;
}
static void setInstance(ShowStatementActivityServiceLocator serviceLocator) {
+ instance = serviceLocator;
}
public BankAccount getAccount() {

0 comments on commit fcb4030

Please sign in to comment.