It crashes because pos is an integer change. If you pass an int value as second paramter you are asking android to look for a String with id the int you provide. If it does not exists the ResourcesNotFoundException
will be thrown
Toast.makeText(MainActivity.this, pos, Toast.LENGTH_SHORT).show();
with
Toast.makeText(MainActivity.this, String.valueOf(pos), Toast.LENGTH_SHORT).show();