public GuidanceView(Context context, AttributeSet attrs) { super(context, attrs); //attr.xml経由で拡張されたプロパティを取得 TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.GuidanceView); this.guidance = a.getString(R.styleable.GuidanceView_guidance);} 拡張されたViewのために、拡張された属性を読み込むには、以前に紹介したコンストラクタで実装するのがコンベンショナルな方法だが、Viewを拡張したくない、又はViewの外部から属性の読みこみをコントロールしたい場合もあるだろう。(私がそうだ) その場合は外部でViewの生成を知る必要がある。