この子クラスは、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が呼び出されたときの主なアクティビティフィードの子メソッドにアクセスする方法を見つける方法が必要になります。
Olly。
あなたは既に '' OnSharedPreferenceChangeListener''を実装しているようですが、この静的な '' updatePreferences''が必要なのかどうか疑問に思っていませんか? – harism