CB-8079 Use activity class package name, but fallback to application package name when looking for splash screen drawable

This commit is contained in:
Andrew Grieve 2014-12-10 21:18:00 -05:00
parent e593fe3f53
commit e320e2504a

View File

@ -67,6 +67,9 @@ public class SplashScreen extends CordovaPlugin {
String splashResource = preferences.getString("SplashScreen", null);
if (splashResource != null) {
drawableId = cordova.getActivity().getResources().getIdentifier(splashResource, "drawable", cordova.getActivity().getClass().getPackage().getName());
if (drawableId == 0) {
drawableId = cordova.getActivity().getResources().getIdentifier(splashResource, "drawable", cordova.getActivity().getPackageName());
}
preferences.set("SplashDrawableId", drawableId);
}
}