Sorry, the code format was somehow messed up in previous email. Here is the
one that is easier to read.
/*-------------------------------------------------------------*/
Code:
private void setAutoPhonecardSelector(int interval) {
Date timeToRun = new Date(System.currentTimeMillis() + interval);
Timer timer = new Timer();
mAutoPhonecardSelector = new TimerTask() {
@Override
public void run() {
mVibrator.vibrate(100);
Toast.makeText(PhoneCardSelector.this, "test",
Toast.LENGTH_LONG).show();
}
};
timer.schedule(mAutoPhonecardSelector, timeToRun);
}
/*-------------------------------------------------------------*/
On Fri, Feb 6, 2009 at 5:40 PM, Xin Zhao <[email protected]> wrote:
> I tried to deploy a timer and switch the user to another dialog for setting
> if times out. But the dialog just cannot display. No error/exception
> reported. Vibration works fine though.
>
> What's wrong?
>
> Code:
>
> private void setAutoPhonecardSelector(int interval) {
> Date timeToRun = new Date(System.currentTimeMillis() + interval);
> Timer timer = new Timer();
>
> mAutoPhonecardSelector = new TimerTask() {
> @Override
> public void run() {
> mVibrator.vibrate(100);
> Toast.makeText(PhoneCardSelector.this, "test",
> Toast.LENGTH_LONG).show();
> }
> };
>
> timer.schedule(mAutoPhonecardSelector, timeToRun);
> }
>
>
>
> Please help!
>
> Thanks in advance!
> xin
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---