Issue
I have this code:
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);
}
I have "translateRight" that is a method that show an animation, but at this method I should pass a resource id; I tried with a string but it don't work, what can I do?
Solution
Resource id - is an integer value. Just pass an int
:
private void translateRight(int resource){
ImageView img = (ImageView) findViewById(resource);
//stuff
}
Answered By - Dmitry Zaytsev
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.