【发布时间】:2018-05-20 15:18:36
【问题描述】:
大家好,我想将 switch 语句中的字符串值从硬编码字符串更改为我在字符串资源中声明的字符串。我在片段页面适配器中。
@Override
public CharSequence getPageTitle(int position) {
switch (position) {
case 0:
return "Museums";
case 1:
return "Culture";
case 2:
return "Food";
default:
return "Views";
}
}
【问题讨论】:
标签: android android-fragments switch-statement