views:

19

answers:

0

This Is The Ticker method I got from StackOver Flow.

public void setText(String text) {
    this.text = text;
}

public String getText() {
    return text;
}

public Ticker(String text) {
    this.text = text;
    final int width = Font.getDefault().getAdvance(text);
    TimerTask timerTask = new TimerTask() {
        public void run() {
            offset--;
            if (offset + width == 0) {
                offset = screenWidth;
            }
            invalidate();
        }
    };
    timer.scheduleAtFixedRate(timerTask, delay, delay);
}

protected void layout(int width, int height) {
    int w = Display.getWidth();
    int h = Font.getDefault().getHeight();
    setExtent(w, h);

}

protected void paint(Graphics graphics) {
    graphics.drawText(text, offset, 0);
}

}

i cant get a ticker via passing

ticker = new Ticker("Deposite reaches record high of YTD 100% growth Rs Million 1,404,555");

the i used button to my display called "PAUSE"..So i need to wait my ticker when i click PAUSE button. it means that i want to wait my animated ticker in couple of minutes ..or i want to stop that animation till press that PAUSE button again.. If Anyone knows..plez..make some comment.Thank you. :(