You may want want to get some ideas from the MVC Struts framework
(internationalization/Errors handling).
I realize that Struts doesn't run on Android. Perhaps you can use some
of their ideas and/or components. The latter
is probably more difficult ... Just a thought
BTW, Struts uses
I think localized error messages are not supported on Android:
http://developer.android.com/reference/java/lang/Throwable.html#getLocalizedMessage%28%29
But your custom formatted error messages could be a good idea.
On 12 November 2010 19:21, Rutton rut...@web.de wrote:
Thanks for your kind
You can catch and format whatever exception you are concerned about.
Use android.content.res.Resource.getString to format messages:
http://developer.android.com/reference/android/content/res/Resources.html#getString(int,
java.lang.Object...)
On Nov 12, 10:21 am, Rutton rut...@web.de wrote:
Thanks for all your help. I worked it out my way. Here is the code for
a getLocalizedMessage in a custom exception:
public String getLocalizedMessage() {
Context c = LearningWordsApplication.getContext();
int id = R.string.error_unknown;
Thanks for your kind explanation.
The describing text is easy to realize, but what I wanted to really
know is, how to deal with (custom formatted) exception messages. So,
is it good practice to use the Exception e.getLocalizedMessage() and
use the Java-mechanism to deal with that, perhaps in
5 matches
Mail list logo