Android: pass a resource id as a parameter
Resource id - is an integer value. Just pass an int
:
private void translateRight(int resource){
ImageView img = (ImageView) findViewById(resource);
//stuff
}
Resource ID is an integer, not a String.