BlackBerry- 현재 응용 프로그램의 ApplicationDescriptor 개체를 가져옵니다

StackOverflow https://stackoverflow.com/questions/1803363

  •  05-07-2019
  •  | 
  •  

문제

현재 실행중인 Applications ApplicationDescriptor 객체에 액세스하고 싶습니다. 현재 버전 번호를 얻을 수 있도록 이것을 원하고 초기 화면에는 "MyApp 버전 XXX"와 같은 제목이 있습니다. ApplicationDescriptor.getVersion()

내가 찾은 한 가지 방법은 사용하는 것입니다.

ApplicationManager manager = ApplicationManager.getApplicationManager();
ApplicationDescriptor[] descriptors = manager.getVisibleApplications();

//Loop round descriptors then use...
ApplicationDescriptor myApp = manager.getProcessId(descriptors[x]);

루프를 사용하여 모든 응용 프로그램을 확인하는 것이 약간 길어진 것처럼 보이며, 더 쉬운 경로가 있기를 바랍니다.

감사

도움이 되었습니까?

해결책

알았어요:

ApplicationDescriptor.currentApplicationDescriptor().getVersion()
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top