mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Fix the way the default application label is retrieved. Check for invalid value.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user