Accessor between classes in one package
Please Login to Remove!
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..
|