-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
只有通过getApplicationContext().getString()才能转换成功 #18
Comments
报什么错 |
没有报错,就是必须要在getString()前加上getApplicationContext()才能正常翻译。但是demo下载下来跑又不需要加上 |
你是在activity里的么 |
是的,我怕自己误操作,把几个activity和资源文件,包括MultiLanguagesApp都是直接复制到新建的项目中。不过没有加入MyService和MyIntentService,(我看源代码 这部分代码不执行也能翻译成功,是这里的原因吗) |
我在mainActivity里也没有用getApplicationContext(),你的activity的attachBaseContext有自己重写么 |
有用过getApplicationContext()的啊,上面那段代码是直接复制过去的,attachBaseContext是在BaseActivity里重写 |
@YonStone 麻烦试试 |
请问解决了嘛? |
tvValue.setText(getString(R.string.tv3_value)); //翻译不成功
tvValue2.setText(getApplicationContext().getString(R.string.tv3_value)); //翻译成功
根据文档接入,但是直接赋值翻译不了
The text was updated successfully, but these errors were encountered: