Switch the language of all app dynamically!

by Stephen Le » Fri, 13 Mar 2009 01:42:40 GMT

Sponsored Links
 Hi all:

I must change en_US Locale into zh_CH dynamically(Like user choose
it). I writed a demo where the code is following:

public void onClick(View v){
     Resources resource=super.getResources();
     Configuration cf=resource.getConfiguration();
     DisplayMetrics dm =resource.getDisplayMetrics();
     resource.updateConfiguration(cf, dm);


}//the end of onClick block

The code works fine.But I think this is very heavy to android
developer so I have to change every activity . Is there anyone know
the quicky way to change language setting?Please tell me the detail
steps if you know. Thanks!

TIP: My enviroment: android-sdk-windows-1.0_r2+JDK 6


Switch the language of all app dynamically!

by MrSnowflake » Fri, 13 Mar 2009 03:54:00 GMT

 Try saving the locale some way, make your own implementation of
Application and change the locale in Application. Then when the users
wants a new locale, restart the activity/task.


Sponsored Links

Other Threads

1. Is this possible with Android

I am thinking about this scenario

1.In  a mobile with Android will be running my script.

2. Someone will dial the number( say number A)  of that mobile where
the script is running.

3.The script will answer and ask the caller( the caller has say number
B) to dial the number where  he wants to be connected to( say number

4.The caller ( with his number   B )will  enter the number C

5.The script will dial that number C and makes  the connection
between  number B and C so that they can talk together.

Is this possible to do that with Android?



2. is there anyway to force locale system numeric to English ?


This Problem Appeared in my SmartPhone and SDK Emulator 2.3

after changing the language to arabic

i can't add new contact it force close
but when i change language back to english the problem disappeared

i think this problem because the system read the number in arabic

look at this

Caused by: android.database.sqlite.SQLiteException: no such column:
: , while compiling: SELECT
FROM raw_contacts LEFT OUTER JOIN data ON
(data.raw_contact_id=raw_contacts._id AND ((mimetype_id= AND data15
NOT NULL) OR (mimetype_id= AND data1 NOT NULL))) WHERE

inside this query there is arabic number and it should not be arabic

i think Force Localize Contacts App to english After decompile it with
apktool and baksmali will fix this problem

this is tutorial but i don't know how to apply it without problem


3. how can i make non-sqlite cursor?

4. GridView onItemClickListener

5. How to convert a image into Base64 string?

6. Emulator GPS Elevation Problem/Bug?

7. problem while executing sql query