私のカスタムでは、指定された inViewGroupに対して特定の数の文字列が必要です。arrayarrays.xml
その条件が満たされない場合はアプリを停止してほしい。
これのベストプラクティスは何ですか?
IllegalStateExceptionからを投げるだけViewGroup constructorですか?
public MyViewGroup( Context context, AttributeSet attrs )
{
super( context, attrs );
if( getResources().getStringArray( R.array.carousellabels ).length != 7 )
throw new IllegalStateException( "There must exactly 7 items for
array resource R.array.carousellabels" );
}