After the locale information is changed, the intent. action_locale_changed message is sent,
In the activitymanagerservice. Java code updateconfigurationlocked function,
Write and receive the Code as follows:
Receive code:
Public class testreceiver extends broadcastreceiver {
@ Override
Public void onreceive (context, intent ){
Log. V ("test", "hello ");
If (intent. getaction (). compareto (intent. action_locale_changed) = 0)
{
// Process
Log. V ("test", "received action_locale_changed ");
}
}
}
In androidmanifest. XML, add the intent filter and declare that the system can receive broadcast messages,
As follows,
<Intent-filter>
<Action Android: Name = "android. Intent. Action. locale_changed"/>
</Intent-filter>
In this way, when locale changes, onreceive will receive the message changed by locale and execute corresponding processing.
From http://blog.csdn.net/liushaogeng/archive/2010/09/28/5912560.aspx