Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calling another class in src

 
kok seong chen
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i m having problem of calling another class in src
for instant, i did create an implicit list to select items. Then each of the item should call another class.
this is what i did

private AnotherClass Variable;

Variable = new AnotherClass();
Variable.startApp();

suppost i expect it to go to another form ~but it never ~
please help me ~
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot call one MIDlet from another one. The life cycle methods (e.g., startApp()) are only called by the AMS.
 
kok seong chen
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so how can i link Implicit list's to another form or function?
case 0:
???
help please ~
thks a lot ,michael yuan
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the commandAction method, you instaniate a new Form object (*not* MIDlet) and set it to display using display.setCurrent() method.
 
kok seong chen
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry michael yuan ~
i don not understand what are u telling
can you please giv me some example?
i still don understand how to call another class
what i know is first declare
private ClassName variable;
second call constructor
variable = new Constructor();
thirdly call function ?
i donno which function to call
plz giv me example ~ or something ~
thks yuan
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Search "MIDlet hello world" on google gives you this example:
http://www.sonyericsson.com/developer/site/global/techsupport/tipstrickscode/java/p_howcreatejavamidlethelloworld.jsp
Notice how the MIDlet class uses the HelloCanvas class. A more complex example involving different threads etc can be found in the appendix of my book:
http://www.enterprisej2me.com/pages/enterprisej2me/codebrowser.php?req=//appendix01/SimpleDemo/src/com/enterprisej2me/simpledemo/DemoMIDlet.html
 
kok seong chen
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thks michael~
btw i m trying to create some winamp player button on mobile phone.
Do you have any sample source of creating winamp player's button?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic