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:
parent
c48dc5f9bd
commit
8c947adc59
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user