Question

I use Robospice in app which will be used in country where English is not native language. But when I launch request and face errors (no network for example), I get toast message "No network available". Is it possible to disable toast messages or change their text?

Thanks

Était-ce utile?

La solution

You should export the string to the strings.xml located in a values folder specific for that country.

You will need to have a folder named "values-XX" where the XX represent the two letter identifier for the country in question (i.e. for Spanish it is values-es). Inside of it you will place all the strings with the language specific translation in a new strings.xml.

Autres conseils

You can very well change the text to be displayed in your toast message.Also you can disable it.just remove the toast from your code. for eg:

Toast.makeText(getApplicationContext(), "this is my Toast message!!! =)",    Toast.LENGTH_LONG).show();

change your string to be displayed in the second argument.in the above case string displayed is "this is my Toast message!!! =)".

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top