私はこのコードを持っています:
translateRight("iv1"); //iv1 is an id of an imageView
private void translateRight(String st){
ImageView img = (ImageView)findViewById(R.id.st);
Animation a = AnimationUtils.loadAnimation(this, R.anim.translate_right);
img.startAnimation(a);
}
アニメーションを表示するメソッドである「translateRight」がありますが、このメソッドではリソースIDを渡す必要があります。文字列を試してみましたが、うまくいきません。どうすればよいですか?