Last active
February 9, 2018 06:04
-
-
Save Nipun2016/31d526c168b83083b3a421b7668bee9a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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