Skip to content

Instantly share code, notes, and snippets.

@Nipun2016
Last active February 9, 2018 06:04
Show Gist options
  • Save Nipun2016/31d526c168b83083b3a421b7668bee9a to your computer and use it in GitHub Desktop.
Save Nipun2016/31d526c168b83083b3a421b7668bee9a to your computer and use it in GitHub Desktop.
public class LocaleTextView extends TextView {
String stringResId;
public LocaleTextView(Context context) {
super(context);
}
public LocaleTextView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.LocaleTextView, 0, 0);
try {
stringResId = ta.getString(0);
} finally {
ta.recycle();
}
}
public String getStringResId(){
return stringResId;
}
public void setStringResId(String id){
this.stringResId = id;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment