Hi, I have difficulties to get variable from other class. See class Mod01 and Mod02 below, in class Mod02 I will get ct1=0, but I want ct1=250. Any help will be gratefully. Thank you.
---------------------------------------
final class Mod01 extends FullScreen {
int ct,coba;
String hits;
[B]public int test() { return coba; } [/B]
Mod02 DisplayMod02;
public Mod01() {}
public void paint(Graphics g) {
g.setBackgroundColor(0x0);
g.clear();
try {Thread.currentThread().sleep(50);} // delay 50 seconds
catch(Exception e) {}
if (ct==0) {
ct=1;
[B]coba=250;[/B]
}
hits="ct="+Integer.toString(ct)+" coba="+Integer.toString(coba);
g.setColor(0xefed42);
g.drawText("Modul 01 : "+hits,10,10);
invalidate();
}
protected boolean navigationClick(int status,int time) {
DisplayMod02 = new Mod02();
getUiEngine().pushScreen(DisplayMod02);
return true;
}
public boolean keyDown(int keycode, int time) {
if (keycode==655360) close();
return true;
}
}
-------------------------------------------
final class Mod02 extends FullScreen {
int ct,ct1;
String hits;
public Mod02() {}
public void paint(Graphics g) {
g.setBackgroundColor(0x0);
g.clear();
try {Thread.currentThread().sleep(50);} // delay 50 seconds
catch(Exception e) {}
if (ct==0) {
ct=1;
[B]Mod01 Kuya = new Mod01();
ct1=Kuya.test();[/B]
}
hits="ct="+Integer.toString(ct)+" ct1="+Integer.toString(ct1);
g.setColor(0xefed42);
g.drawText("Modul 02 : "+hits,10,10);
invalidate();
}
public boolean keyDown(int keycode, int time) {
if (keycode==655360) close();
return true;
}
}
----------------------------------------