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)) {
|
if (types.isDefined(title)) {
|
||||||
actionBar.setTitle(title);
|
actionBar.setTitle(title);
|
||||||
} else {
|
} else {
|
||||||
var defaultLabel = application.android.nativeApp.getApplicationInfo().labelRes;
|
var appContext = application.android.context;
|
||||||
actionBar.setTitle(defaultLabel);
|
var appInfo = appContext.getApplicationInfo();
|
||||||
|
var appLabel = appContext.getPackageManager().getApplicationLabel(appInfo);
|
||||||
|
if (appLabel) {
|
||||||
|
actionBar.setTitle(appLabel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user