이 하위 클래스는 livewallpaper 서비스 내에서 부모 클래스에 어떻게 액세스합니까?livewallpaper 서비스 클래스 내의 하위 메서드 액세스
public class LiveWallpaperService extends WallpaperService
{
public static final String SHARED_PREFS_NAME="t_settings";
public static final String strSharedPrefs="t_settings";
@Override
public Engine onCreateEngine()
{
return new LiveWallpaperWallpaperEngine();
}
public static void updatePreferences()
{
//This is the class that needs to access the child method.
Log.w("yo", "resumed from main activity");
}
public class LiveWallpaperWallpaperEngine extends Engine implements SharedPreferences.OnSharedPreferenceChangeListener
{
//This is the child method I'm trying to access.
public void updatePreferencesB(){}'
정적 응용 프로그램을 충돌 때문에 내가 할 수없는 초록을 사용해 보았습니다. 정적으로는 개체를 변경할 수 없습니다. 기본 활동은 파괴 시험 및 작동 될 때
public static void updatePreferences
가 호출됩니다. 이제는 onDestroy가 호출 될 때 주요 활동 피드의 하위 메소드에 액세스하는 방법을 찾는 방법이 필요합니다.
올리.
''OnSharedPreferenceChangeListener''를 이미 구현 한 것 같아요.이 정적 인''updatePreferences''가 필요한 것에 궁금해 할 수 없습니까? – harism