2014-12-24 1 views
0

다음 소스 코드에 SystemProperties를 설정하는 코드가 있습니다.SystemProperties.set not working

 SystemProperties.set("ro.csc.countryiso_code","KoreaA"); 

     String country1 = SystemProperties.get("ro.csc.countryiso_code"); 

     Log.e("DebugA",country1); 
     SystemProperties.set("ro.csc.countryiso_code","KoreaB"); 
     String country2 = SystemProperties.get("ro.csc.countryiso_code"); 

     Log.e("DebugB",country2); 

`

이유는 SystemProperties에 두 번째 변경을받지는 무엇입니까? 그러나 로그 캣 디버그에 항상 무엇입니까 : - : - DebugA KoreaA은 : - 장치가 꺼져 있고 전원이 켜져 때까지 DebugB KoreaA 은 단지 한 번 우리는 우리의 코드에서 SystemProperties를 설정하고 그것이 영원히 지속됩니다인가 다시?

난 내 장치의 전원을 끈 후 다시 켠 후 변경 확인으로 : - 나는 SystemProperties을 설정하는 내 소스 코드에 코드를 다음 한

.

 SystemProperties.set("ro.csc.countryiso_code","KoreaB"); 

     String country1 = SystemProperties.get("ro.csc.countryiso_code"); 

     Log.e("DebugA",country1); 
     SystemProperties.set("ro.csc.countryiso_code","KoreaA"); 
     String country2 = SystemProperties.get("ro.csc.countryiso_code"); 

     Log.e("DebugB",country2); 

그리고 로그 캣 디버그에 항상 무엇입니까

: - 은 : - DebugA KoreaB은 는 : - DebugB KoreaB은

+0

'SystemProperties'에 익숙하지 않지만'SharedPreferences'를 사용하지 않는 이유는 무엇입니까? – Mahm00d

+0

SharedPref를 사용하십시오. 더 나은 접근을 위해서 –

+0

그건 알았어 .. 나는 우리가 SystemProperties를 사용하여 변경할 수 있는지 묻고있다. 그렇다면 어떻게 할 수 있습니까? –

답변

2
 SystemProperties.set("ro.csc.countryiso_code","KoreaA"); 
속성의 이름은 "RO"로 시작

은, 그것이 의미합니다 읽기 전용 속성이므로 한 번 설정하면 더 이상 변경할 수 없습니다.

+0

OS 자체로 변경할 수 있습니까? –

+1

시스템 앱에서 'ro'속성을 변경할 수 없습니다. 대신 "지속"을 사용하십시오. @ParthSrivastav – wrkwrk