Skip to content

Commit

Permalink
Issue BaseballCardTracker#278: Automatically show `BaseballCardDetail…
Browse files Browse the repository at this point in the history
…s` on the right
  • Loading branch information
codeguru42 committed Jul 3, 2014
1 parent 47a5549 commit 7d7db7c
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,24 @@ public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.main);

if (savedInstanceState == null && !isInTwoPaneMode()) {
if (savedInstanceState == null) {
Uri uri = BaseballCardContract.getUri(this.getPackageName());
Cursor cursor = this.getContentResolver().query(uri,
BaseballCardContract.PROJECTION, null, null, null);

FragmentTransaction ft = this.getSupportFragmentManager().beginTransaction();
if (cursor == null || cursor.getCount() == 0) {
if (isInTwoPaneMode()) {
ft.add(R.id.fragment_holder, new BaseballCardDetails());
} else {
ft.add(R.id.fragment_holder, new BaseballCardList());
if (cursor == null || cursor.getCount() == 0) {
ft.add(R.id.fragment_holder, new BaseballCardDetails());
} else {
ft.add(R.id.fragment_holder, new BaseballCardList());
}

getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
ft.commit();

getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
}

Expand Down

0 comments on commit 7d7db7c

Please sign in to comment.