how to handle threads

Forum for J2ME mobile games related topics including programming doubts, books and other resources for J2ME game development

how to handle threads

Postby ganeshd » Thu Mar 01, 2007 2:33 pm

hello friends,,
m developing an application which i am trying server connection for which i made two classes one separetely for network connection in which i am using threads.
so wen from main program i am giving call(trying to use method of) to another class m getting an error null pointer.but i hav declared all the things that i am using.
i think wen calling a method of another thread main thread culd not recognise that method.
now hoe to suspend main thread or how to handle this
ganeshd
 
Posts: 5
Joined: Thu Feb 22, 2007 8:23 am

Postby DevelopmentTeam » Tue Mar 06, 2007 3:56 am

In such case you should have a third class which is updated by both the threads and all functions in it have syncronized keyword. This will help in your case. If the answer is not specific and helpful, please give us a indetailed question regarding this.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India


Return to J2ME Games

Who is online

Users browsing this forum: Exabot [Bot] and 1 guest

cron