在類a which extends MainScreen
中,我想打b
班,其中extends MainScreen
也是。如何調用並通過其他主屏幕?
當我通過b.this
進入所示的功能錯誤No enclosing instance of the type b is accessible in
在類a which extends MainScreen
中,我想打b
班,其中extends MainScreen
也是。如何調用並通過其他主屏幕?
當我通過b.this
進入所示的功能錯誤No enclosing instance of the type b is accessible in
你好,這是很簡單的,我會告訴你簡單的方法
假設你有兩個類
1)屏幕截圖1
2 )screen2
screen1.java
public class screen1 extends MainScreen
{
// some lines of code
//this is method to going to next screen in side that method
UiApplication.getUiApplication().pushScreen(new screen2(screen1.this));
}
screen2.java
public class screen2 extends MainScreen
{
private Screen1 screen1Object;
// here take constructer
public screen2(Screen1 screen1Object)
{
this.screen1Object=screen1Object;
}
}
在這裏,您可以使用screen1Object
我的意思是我想通過'屏幕3 '當'屏幕1'調用'屏幕2'時進入'屏幕2' – 2012-07-12 10:31:26
更好的學習基礎知識 – 2012-07-12 11:31:30
您可以使用此代碼
UiApplication.getUiApplication().invokeAndWait(new Runnable()
{
public void run()
{
UiApplication.getUiApplication().pushScreen(new NewScreen());
}
});
可以請你給我提供更多信息,否則來到這個房間HTTP: //chat.stackoverflow.com/rooms/4014/knowledge-sharing-center-for-blackberry-android-and-java這裏有人可以幫到你 – 2012-07-12 07:22:51