From: Streets Of Boston <flyingdutc...@gmail.com>
Date: Mon, 5 Dec 2011 06:30:13 -0800 (PST)
Local: Mon, Dec 5 2011 9:30 am
Subject: Go To ( http://adf.ly/20PrE )-)-) [android-developers] Re: getString in a class with no context <- Runtime Error Resource Not Found
It's great you got it to work. In a method of your activity or another context, you could just do: If you want to access localized resources/strings in code that does not public class MyApp extends Application { ... public LanguagePack getLanguagePack() { } public class LanguagePack { private final Context context; public LanguagePack(Context context) { this.context = context.getApplicationContext(); } public String getString(int resID) { } And everywhere in your code, you could do MyApp.getLanguagePack().getString(R.string.some_string); -- -- Unsubscribe All Group Post :- http://j.gs/624707/unsubscribe http://q.gs/624707/unsubscribe Subscribe All Group Post :- http://j.gs/624707/subscribe Join Now Today (Paid Income) :- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||