Java.Util.ResourceBundle.GetBundle Method
Finds the named resource bundle for the specified Locale and ClassLoader.

Syntax

[Android.Runtime.Register("getBundle", "(Ljava/lang/String;Ljava/util/Locale;Ljava/lang/ClassLoader;)Ljava/util/ResourceBundle;", "")]
public static ResourceBundle GetBundle (string bundleName, Locale locale, Java.Lang.ClassLoader loader)

Parameters

bundleName
the name of the ResourceBundle.
locale
the Locale.
loader
the ClassLoader to use.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Util.MissingResourceExceptionif the ResourceBundle cannot be found.

Remarks

Finds the named resource bundle for the specified Locale and ClassLoader. The passed base name and Locale are used to create resource bundle names. The first name is created by concatenating the base name with the result of Locale.ToString. From this name all parent bundle names are derived. Then the same thing is done for the default Locale. This results in a list of possible bundle names. Example For the basename "BaseName", the Locale of the German part of Switzerland (de_CH) and the default Locale en_US the list would look something like this:

  1. BaseName_de_CH
  2. BaseName_de
  3. Basename_en_US
  4. Basename_en
  5. BaseName
This list also shows the order in which the bundles will be searched for a requested resource in the German part of Switzerland (de_CH). As a first step, this method tries to instantiate a ResourceBundle with the names provided. If such a class can be instantiated and initialized, it is returned and all the parent bundles are instantiated too. If no such class can be found this method tries to load a .properties file with the names by replacing dots in the base name with a slash and by appending ".properties" at the end of the string. If such a resource can be found by calling Java.Lang.ClassLoader.GetResource(string) it is used to initialize a Java.Util.PropertyResourceBundle. If this succeeds, it will also load the parents of this ResourceBundle. For compatibility with older code, the bundle name isn't required to be a fully qualified class name. It's also possible to directly pass the path to a properties file (without a file extension).

[Android Documentation]

Requirements

Namespace: Java.Util
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1