This may be a really stupid question or not even possible.
I am not sure if this would be called as a method, but going with this. How can I pass getCountryName(); as parameter? like show below;
public static String Utils(Something something){
Geocoder geoCoder = new Geocoder(context, Locale.getDefault());
List<Address> address = null;
if (geoCoder != null) {
try {
address = geoCoder.getFromLocation(lat, lng, 1);
} catch (IOException e1) {
e1.printStackTrace();
}
if (address.size() > 0) {
return address.get(0).getCountryName(); // pass this as parameter (something)
}
}
return null;
}
and then call it like so,
Utils(getCountryName());
Utils(getCountryCode());
etc.