1 package com.google.android.DemoKit; 2 3 import android.content.res.Resources; 4 import android.view.View; 5 6 public abstract class AccessoryController { 7 8 protected DemoKitActivity mHostActivity; 9 AccessoryController(DemoKitActivity activity)10 public AccessoryController(DemoKitActivity activity) { 11 mHostActivity = activity; 12 } 13 findViewById(int id)14 protected View findViewById(int id) { 15 return mHostActivity.findViewById(id); 16 } 17 getResources()18 protected Resources getResources() { 19 return mHostActivity.getResources(); 20 } 21 accessoryAttached()22 void accessoryAttached() { 23 onAccesssoryAttached(); 24 } 25 onAccesssoryAttached()26 abstract protected void onAccesssoryAttached(); 27 28 }