Fixed bug

(getActivity returns null until the fragment has been added to the layout, but getTitle will be called before)
This commit is contained in:
fkloft 2013-07-26 23:22:33 +02:00
parent c48dc5f9bd
commit 8c947adc59
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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);