아래 코드와 같은 서비스를 시작한 후에이 서비스 클래스의 메서드와 변수에 액세스해야합니다.Android - 서비스의 메소드 및 변수에 액세스하는 방법
ComponentName comp = startService(new Intent(this, ClipboardService.class));
comp 변수를 통해 메소드와 변수에 액세스 할 수 없습니다. 이 경우 ClipboardService.class의 내용에 액세스 할 수 있도록 변수를 설정하는 방법은 무엇입니까? 감사.
정적이어야합니다. –
이 시나리오에서는'startService()'대신'bindService()'를 사용하십시오. – CommonsWare
'bindService()'의 실례를 여기서 볼 수 있습니다 : http://blog.blundell-apps.com/notification-for-a-user-chosen-time/ – Blundell