Skip to content

Instantly share code, notes, and snippets.

@Nipun2016
Last active February 9, 2018 06:03
Show Gist options
  • Save Nipun2016/a313d9a884356a64ac53e4e9b2047d9f to your computer and use it in GitHub Desktop.
Save Nipun2016/a313d9a884356a64ac53e4e9b2047d9f to your computer and use it in GitHub Desktop.
public static class OnLocaleChangeReceiver extends BroadcastReceiver{
com.hypersoft.walletapp.ui.customviews.LocaleTextView v;
public void setTextView(com.hypersoft.walletapp.ui.customviews.LocaleTextView v){
this.v = v;
}
@Override
public void onReceive(Context context, Intent intent) {
//Utility.debugger("onReceive called "+v);
if(v != null && v.getStringResId() != null && !v.getStringResId().equalsIgnoreCase("")){
Utility.debugger("String "+context.getResources().getString(v.getResources().getIdentifier(v.getStringResId(), "string", context.getPackageName())));
v.setText(v.getResources().getIdentifier(v.getStringResId(), "string", context.getPackageName()));
}else{
if(v != null){
v.invalidate();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment