In PHP, there is such a thing as:
$a = "name"; $$a = "Hello"; echo $name; // выводит "Hello" Tell me, how can this be implemented dynamically in Java? In general, it is interesting how to do this in Java, as in PHP in the example below:
$name = "track"; for (i = 1; i <= 10; i++) { $temp = $name . $i; // Получаем track1 SendToFunction($$temp); //Передаем в функцию переменную $track1 } Why do I need it at all? I want instead of explicitly specifying track1 in track1.getDrawable()).getBitmap(); use the variable I need, so as not to write a lot of code, because Not all trackX I have to pass to the function