我尝试使用GuidedStepFragment来整理我的电视应用的设置。我遇到问题,该步骤选项像EditText字段一样工作,但我不使用GuidedAction.Builder.editable()方法。
设置片段代码
public static class SettingsFragment extends GuidedStepSupportFragment {
@Override
public GuidanceStylist.Guidance onCreateGuidance(Bundle savedInstanceState) {
String title = "Настройки1";
String description = "Настройки2";
String breadcrumb = "Настройки3";
Drawable icon = getActivity().getResources().getDrawable(R.drawable.app_icon_quantum);
return new GuidanceStylist.Guidance(title, description, breadcrumb, icon);
}
@Override
public void onCreateActions(@NonNull List<GuidedAction> actions, Bundle savedInstanceState) {
actions.add(new GuidedAction.Builder()
.id(1)
.infoOnly(true)
.title("Адрес сервера")
.build());
}
}
我如何添加片段
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
GuidedStepSupportFragment.add(getSupportFragmentManager(), new SettingsFragment());
}
答案 0 :(得分:0)
经过一些调查后,我注意到这些错误仅在应用程序在平板电脑上运行时出现,或者我尝试通过鼠标在模拟器上导航。