From 8c947adc59236c809cd40e8bfb3133add24376ef Mon Sep 17 00:00:00 2001 From: fkloft Date: Fri, 26 Jul 2013 23:22:33 +0200 Subject: [PATCH] Fixed bug (getActivity returns null until the fragment has been added to the layout, but getTitle will be called before) --- mobile/src/com/cradle/iitc_mobile/share/IntentFragment.java | 2 +- mobile/src/com/cradle/iitc_mobile/share/ShareActivity.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mobile/src/com/cradle/iitc_mobile/share/IntentFragment.java b/mobile/src/com/cradle/iitc_mobile/share/IntentFragment.java index 2fda0f6b..bbeca174 100644 --- a/mobile/src/com/cradle/iitc_mobile/share/IntentFragment.java +++ b/mobile/src/com/cradle/iitc_mobile/share/IntentFragment.java @@ -21,7 +21,7 @@ public class IntentFragment extends Fragment implements OnScrollListener, OnItem } public String getTitle() { - return getActivity().getString(getArguments().getInt("title")); + return getArguments().getString("title"); } @Override diff --git a/mobile/src/com/cradle/iitc_mobile/share/ShareActivity.java b/mobile/src/com/cradle/iitc_mobile/share/ShareActivity.java index 7aeb43d1..22a84cf6 100644 --- a/mobile/src/com/cradle/iitc_mobile/share/ShareActivity.java +++ b/mobile/src/com/cradle/iitc_mobile/share/ShareActivity.java @@ -25,7 +25,7 @@ public class ShareActivity extends FragmentActivity implements ActionBar.TabList IntentFragment fragment = new IntentFragment(); Bundle args = new Bundle(); args.putParcelable("intent", intent); - args.putInt("title", label); + args.putString("title", getString(label)); args.putInt("icon", icon); fragment.setArguments(args); mFragmentAdapter.add(fragment);