2017-03-09 93 views
0

我試圖根據設備的語言指向具有不同語言的隱私策略的其他網址。我有一個string.xml中的url,在privacypolicyurl的關鍵字下,我似乎無法讓該id出現在java類中。試圖根據默認的本地化語言更改網址

public void privacyPolicy(){ //String url = "https://github.com/*******/MobileAppPrivacyPolicy/blob/master/MobilePrivacyPolicy.txt"; url = R.id.pr Uri uri = Uri.parse(getResources().getText(R.id.privacypolicy)); startActivity(new Intent(Intent.ACTION_VIEW, uri)); }

回答

0

您使用了錯誤的方法getResources()。你必須使用的getString()

Like in here

順便說一句,你應該問一個新之前檢查你的問題之前的問題。

+0

對不起,大腦並沒有努力想出一個好的問題來尋找。 – poboy975