Fix the way the default application label is retrieved. Check for invalid value.

This commit is contained in:
atanasovg
2015-08-07 17:14:29 +03:00
parent 171017e526
commit 0df2b56095

View File

@@ -182,8 +182,12 @@ export class ActionBar extends common.ActionBar {
if (types.isDefined(title)) {
actionBar.setTitle(title);
} else {
var defaultLabel = application.android.nativeApp.getApplicationInfo().labelRes;
actionBar.setTitle(defaultLabel);
var appContext = application.android.context;
var appInfo = appContext.getApplicationInfo();
var appLabel = appContext.getPackageManager().getApplicationLabel(appInfo);
if (appLabel) {
actionBar.setTitle(appLabel);
}
}
}
}