Hi Guys,
I thought I would post here first. I’m writing a custom text manipulation class that is drawn on a SurfaceView that does different things. One of the things that it does is move text from one point to another. But, I need to know when it’s done. In comes the Custom Event Listener. This is what I’ve done so far:
In the TextObject class I have:
public interface OnMoveDoneListener {
public abstract void onMoveDoneEvent();
}
and
// Allows the user to set a Listener and react to the event
public void setOnMoveDoneListener(OnMoveDoneListener onMoveDoneListener2) {
onMoveDoneListener = onMoveDoneListener2;
}
/**
* Method which updates the droid's internal state every tick
*/
private void onMoveDone() {
if (onMoveDoneListener != null) {
onMoveDoneListener.onMoveDoneEvent();
}
}
if (x_done && y_done) {
moving = false;
onMoveDone();
}
In the activity I have:
TextT2.setOnMoveDoneListener(new OnMoveDoneListener(){
@Override
public void onMoveDoneEvent() {
// Handle the event here
if(true){
TextT2.setText("done.");
} else {
TextT2.setText("Nope.");
}
}
});
This is the error I have:
Maybe there’s something really obvious that I’m missing after having stared at it too long. This is my first time setting up a custom listener. I had to rewrite how my app works because I use alphanimations and after a recent android update (or something) the alphanimation causes the text to disappear, but no matter what I do, the text I’m using will NOT reappear. - especially on Samsung phones. I figured it was time to rewrite it so that I can do more with it.
In case you’re wondering the app is Bible Book Order! https://play.google.com/store/apps/details?id=com.biblebookordergame.biblebookorder&feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5iaWJsZWJvb2tvcmRlcmdhbWUuYmlibGVib29rb3JkZXIiXQ…
OR
Anybody have any insights?
Thanks,
Rick