BlackBerryForums.com : Your Number One BlackBerry Community      

»Sponsored Links



Closed Thread
 
LinkBack Thread Tools
  (#1 (permalink)) Old
Zhi Li Offline
Knows Where the Search Button Is
 
Posts: 18
Join Date: Mar 2006
Model: 7250
Question Accessor between classes in one package - 07-27-2006, 03:19 PM

Hello all,
The main class of my application get the mail which user just clicked, then call second class(push a new screen) to format content of Body and display it, I need an accessor to transfer the mail(object) from first class to second, but it failed, can any one help me to do it?
in first class:
public final class firstClass extends UiApplication implements ViewListener {
....
public void open(MessageEvent e) {
Message msg=e.getMessage();
String subject=msg.getSubject();

if (subject.indexOf("mykey")>-1) {
_secondscreen=new secondScreen();
UiApplication.getUiApplication().pushModalScreen(_ secondscreen);
}

}

public Message getWhichmail() {
return this.whichmail;
}
protected void setWhichmail(MessageEvent e) {
whichmail =e.getMessage();
}

in secondscreen:

private firstClass first;
public secondScreen() {
// super.close();
firstClass app=new firstClass();

Message msg=app.getWhichmail();
...
but it failed in firstClass app=new firstClass();
please help!

Last edited by Zhi Li : 07-27-2006 at 03:37 PM.
   
Sponsored Links
Please Login or Register to Remove these Advertisements!

  (#2 (permalink)) Old
donricouga Offline
Thumbs Must Hurt
 
Posts: 58
Join Date: Jul 2006
Location: Atlanta
Model: 8703e
Carrier: Sprint
Default 07-27-2006, 03:28 PM

I'm guessing you left out the package names of both classes on purpose.
How are you building this app (IDE) ?
   
  (#3 (permalink)) Old
Zhi Li Offline
Knows Where the Search Button Is
 
Posts: 18
Join Date: Mar 2006
Model: 7250
Default 07-27-2006, 03:35 PM

hi,
the pakcage is on top of both classes, i use BB IDE 4.0.1 and run code in simulator
   
  (#4 (permalink)) Old
donricouga Offline
Thumbs Must Hurt
 
Posts: 58
Join Date: Jul 2006
Location: Atlanta
Model: 8703e
Carrier: Sprint
Default 07-27-2006, 03:58 PM

What is the exact error you are getting ?
   
  (#5 (permalink)) Old
Zhi Li Offline
Knows Where the Search Button Is
 
Posts: 18
Join Date: Mar 2006
Model: 7250
Default 07-27-2006, 04:17 PM

its ok to build the project, but when debug it, it stop at "firstClass app=new firstClass" and show"code is not available"
   
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On






Copyright © 2004-2008 BlackBerryNews.com, BlackBerryFAQ.com, BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of Research In Motion Limited.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.1