1

Was wondering if I could get some help with the following. I'm creating a J2ME app which sends/receives sms messages for login.

So the user provides their username and password in some textfields and an sms is sent to check if the details provided are correct. An sms is sent back to sender with a true/false on whether to allow login.

Now the bit I'm stuck on. I can send the sms with the login details, and can send back a message to the sender but I want to display a dialog with please wait until the message is received. I probably need to use threads/sleep etc but not exactly sure how

Most of the sending and receiving code is similar to here

Gray
  • 7,050
  • 2
  • 29
  • 52
user913059
  • 579
  • 4
  • 19

1 Answers1

2

you need to do static dialog that can you dismis,when you recieve the message.

 Display.getInstance().callSerially(new Runnable() {

                public void run() {
                     progressDialog = new Dialog(); // progressDialog while be static 
                     Label msg= new Label("Wait");
                     progressDialog.addComponent(msg);
                }
            });
neb1
  • 209
  • 1
  • 12
  • How can I dispose the dialog. progressDialog.dispose() doesn't seem to work – user913059 Jan 16 '13 at 11:05
  • where you call to dispose. you need call when you recieve message. your progress dialog must to be static or member of clss that you can call. – neb1 Jan 16 '13 at 11:09
  • How can I make my app show the dialog and then wait at most 10 seconds until a reply is received then close the dialog – user913059 Jan 16 '13 at 11:44