public abstract class BaseWatchFace extends CanvasWatchFaceService
private final String name;
public BaseWatchFace (String name) {
this.name = name;
}
@Overridepublic void onCreate() {
super.onCreate();try {Intent i = new Intent(this, Class.forName(getPackageName() + ".watchface" + name));
startService(i);} catch (ClassNotFoundException e) {
Common.Log("WallpaperService not found.");
throw new RuntimeException(e);
}
}
public WatchFace1 extends BaseWatchFace {
public WatchFace1() {
super("1");
}
}
public WatchFace2 extends BaseWatchFace {
public WatchFace2() {
super("2");
}
}
...