getString(int)
only works for Classes that have access to a Context
- Fragments
, Activities
, etc.
Given that this an Adapter
class, it won't have direct access to a Context
, so you should probably pass one in with the constructor.
private Context mContext = null;
public SectionsPagerAdapter(FragmentManager fm, Context context) {
super(fm);
mContext = context;
}
and then use the member field to access getString(int)
return mContext.getString(R.string.myFriendsTab).toUpperCase(1);