Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Java Threads - J2ME

  Asked By: Richard    Date: Sep 02    Category: Java    Views: 673
  

Lets say i have 2 midlet class called MainDisplay and
CommunicationHandler. In the MainDisplay, has a login form for users
to login. In order for users to login, it needs to connect to the
HTTP server through CommunicationHandler.login().


How do i move from MainDisplay to another thread called
CommunicationHandler?

Please help me out. I have tried this for the last two days. And
unsuccessful to call another thread.

Here are the part of the code in MainDisplay:

if (command.getCommandType() == Command.OK) {
Thread comthread = new Thread(communicationhandler) {
public void run() {
String user = null;
String pass = null;
user = username.getString();
pass = password.getString();
communicationhandler.login(user, pass);
comthread.start();
}

comthread.stop();

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Java Threads - J2ME Or get search suggestion and latest updates.




Tagged: