Is there any other Method other than pushscreen to go to next Screen?
I want to show another screen, when the user clicks in a L开发者_JAVA技巧istField.
But my class containing ListField extends MainScreen!
How can I push to another screen?
Is there any way other than pushScreen to go to another screen?
OverRide NavigationClick ,below is the example
public boolean navigationClick(int status,int time){
Field focus = _countries.getLeafFieldWithFocus();
if(focus instanceof ListField){
ListField listField = (ListField)focus;
country = listField.getCallback().get(listField,listField.getSelectedIndex()).toString();//this will return the text clicked from the listfield
TransitionContext transition = new TransitionContext(TransitionContext.TRANSITION_FADE);
transition.setIntAttribute(TransitionContext.ATTR_DURATION,500);
transition.setIntAttribute(TransitionContext.ATTR_DIRECTION,TransitionContext.DIRECTION_DOWN);
transition.setIntAttribute(TransitionContext.ATTR_STYLE,TransitionContext.STYLE_PUSH);
UiEngineInstance engine = Ui.getUiEngineInstance();
engine.setTransition(MyApp.scr,MyScreen._radio,UiEngineInstance.TRIGGER_PUSH,transition);
MyApp.scr=null;
UiApplication.getUiApplication().popScreen(UiApplication.getUiApplication().getActiveScreen());
UiApplication.getUiApplication().pushScreen(MyScreen._radio);
}
return true;
}
精彩评论