1
나는 Android에서 왔고 지금은 Blackberry를 배우고 있습니다.Blackberry - 다른 클래스 인스턴스 컨텍스트에 액세스하기
다른 클래스에 액세스하려면 java에서 컨텍스트가 "this"와 비슷해야합니다. 어떻게 블랙 베리에서 그것을 할 수 있습니까?
public final class MyScreen extends MainScreen
{
//Creates a new MyScreen object
public MyScreen()
{
// Set the displayed title of the screen
setTitle("MyTitle");
process1 x = new process1(); // will add the labelfield
}
}
이 변경 process1 생성자에
public class process1
{
public process1()
{
//i'm trying to get the context of MyScreen so i can add the field in this class
MyScreen.add(new Labelfield("test"));
//but its giving error with the message cannot make static reference
}
}
를 사용 : 고 객 로고 목적을'process1 X = 새로운 process1 (이)' –
덕분에, 왜 내가 전에이를 생각하지 않았다. :디 – Pasca