09-15-2012 12:19 AM
i have created a custom image button,one is play image button and one is pause image button,i want to switch between play and pause(i.e when the user clicks on the button,it has to change(play to pause or pause to play),for my requirement i have referred this example url when i execute my program ,i am able to display the button,but when i click on the button,i am not able to change the imagebutton(play to pause),can any one help me?
09-15-2012 12:26 AM
09-15-2012 12:26 AM
09-15-2012 12:44 AM - edited 09-15-2012 12:44 AM
how to identify my click event in navigation method,i roughly written like this ,can you chec this once
boolean result=fasle;
protected boolean navigationClick(int status, int time){
if(result){
_currentPicture=_offPicture;
}
else{
_currentPicture=_onPicture;
}
return true;
}
09-15-2012 12:52 AM - edited 09-15-2012 12:52 AM
when creating button the button is not playing so it was false;
boolean play = false;
protected boolean navigationClick(int status, int time){
// when user click this will create a notification
play = play ? false : true;
if(play){
_currentPicture=_offPicture;
}
else{
_currentPicture=_onPicture;
}
fieldChangeNotify(1);
return true;
}
09-15-2012 12:52 AM
Hello,
Please follow below step.
1.Take one boolean variable
2.When user click into Playbutton at that time this variable assign true.
3. And when user click into PushButton at that time variable value assign false.
Note :- As per code i take one manager innerplayerControlManager.
if (_isPlaying) {
pushButton = new CustomBitmapField(pushFocus, pushNormal,
FIELD_HCENTER);
pushButton.setChangeListener(this);
innerplayerControlManager.add(pushButton);
} else {
playButton = new CustomBitmapField(playFocus, playNormal,
FIELD_HCENTER);
playButton.setChangeListener(this);
innerplayerControlManager.add(playButton);
}
Click Event
if (field instanceof CustomBitmapField) { if (context == 0) { if (field.equals(playButton)) { try { _isPlaying = true; innerplayerControlManager.deleteAll(); } catch (Exception e) { // TODO: handle exception } } else if (field.equals(pushButton)) { _isPlaying = false; innerplayerControlManager.deleteAll(); }
Thanks.
--------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
09-15-2012 04:30 AM
If you got success and solved this issue then click into Accept Button.
09-15-2012 04:59 AM
i haven't try your answer,if it solves ,sure ,i will accept ,what is this reference innerplayerControlManager