Codenameone 如何在codename one中获取当前滑动选项卡的选定索引值?

Codenameone 如何在codename one中获取当前滑动选项卡的选定索引值?,codenameone,Codenameone,我使用codename one动态滑动tabs来准备一些单选按钮,但是在滑动tabs时getSelectedIndex()方法给出了previous tabs值(previous在这个意义上假设我将我的选项卡从0移动到1,所以它给了我0)因此,如何获取当前选项卡的值,因为基于此selectedIndexTab值,我希望我的单选按钮被选中 这是我的密码 TableLayout t1=new TableLayout(1, 5); radioTypeContainer=new Container(t1

我使用codename one动态滑动tabs来准备一些单选按钮,但是在滑动tabs时getSelectedIndex()方法给出了previous tabs值(previous在这个意义上假设我将我的选项卡从0移动到1,所以它给了我0)因此,如何获取当前选项卡的值,因为基于此selectedIndexTab值,我希望我的单选按钮被选中

这是我的密码

TableLayout t1=new TableLayout(1, 5);
radioTypeContainer=new Container(t1);
for(i=0;i<5;i++){
t.addTab("Tab2"+i, new SpanLabel("Some text directly in the tab"));
firstTab = new RadioButton[i];
plain = new RadioButton("");
plain.setName("rdb"+i);
rbt =new RadioButton();
rbt.setName("rbt"+i);
radioTypeContainer.add(rbt);
finalRadioList.add(rbt.getName());
finalRadioList.add(t.getTabUIID());
}
borderLayoutContainer.add(BorderLayout.SOUTH,radioTypeContainer);
t.addSelectionListener((i1, i) -> {
Log.p("====***======="+t.getSelectedIndex());
});
TableLayout t1=新的TableLayout(1,5);
radioTypeContainer=新容器(t1);
对于(i=0;i{
Log.p(“===***===”+t.getSelectedIndex());
});

提前感谢

选择中选择的新闻更改方法提供选项卡的当前位置,如下面的代码所示

 t.addSelectionListener(new SelectionListener() {

            @Override
            public void selectionChanged(int oldSelected, int newSelected) {

Log.p("====***======="+newSelected);
            }
        });