良辰 发布的文章

Happiness
幸福

  1. You don’t have to love your job. Jobs are a way to make money. Many people live fine lives in okay jobs by using the money they make on things they care about.
  2. 你不必热爱你的工作。工作是一种赚钱的方式。许多人通过将赚到的钱用在他们关心的事情上,过着美好的生活。
  3. Sturgeon’s law states that 90% of everything is crap. If you dislike poetry, or fine art, or anything, it’s possible you’ve only ever seen the crap. Go looking!
  4. 斯特金定律指出,90% 的东西都是垃圾。如果你不喜欢诗歌、美术或其他任何东西,你可能只看过那些废话。去找吧!
  5. People don’t realize how much they hate commuting. A nice house farther from work is not worth the fraction of your life you are giving to boredom and fatigue.
  6. 人们没有意识到他们有多么讨厌通勤。离工作地点较远的漂亮房子不值得你把生命中的一小部分花在无聊和疲劳上。

- 阅读剩余部分 -

报错org.cocos2dx.lib.Cocos2dxHelper.unregisterBatteryLevelReceiver
稳定的复现方法:从应用市场打开游戏,回到桌面,再从桌面点击游戏icon 热启动游戏,
过两三秒闪退。 分析了奔溃日志,发现错误集中在某几个平台,且同一手机上,有的渠道的包有这个问题,有的没有,可以确定是打出来的包的问题。

- 阅读剩余部分 -

在 Android 系统中,可以通过 Locale 类获取当前设备的语言设置,并通过 getLanguage() 方法获取语言的简写代码。

        // 获取当前设备的语言和国家代码
        Configuration config = getResources().getConfiguration();
        String languageCode = config.locale.getLanguage();
        String countryCode = config.locale.getCountry();
        // 判断语言和地区
        if ("zh".equals(languageCode)) {
            if ("CN".equals(countryCode)) {
                Log.d("Language", "当前语言是简体中文");
            } else if ("TW".equals(countryCode) || "HK".equals(countryCode)) {
                Log.d("Language", "当前语言是繁体中文");
            } else {
                Log.d("Language", "当前语言是中文,但地区未知");
            }
        } else {
            Log.d("Language", "当前语言不是中文,语言代码: " + languageCode);
        }

- 阅读剩余部分 -