android - Get standard layout attributes -


i extended class imageview , added custom parameters. succeed these custom parameters code, using method context.gettheme().obtainstyledattributes().

what need access standard parameters of imageview object, such android:src , android:background. know exist class android.r.styleable.* use parameters, class has been deprecated (and not visible anymore). can access android parameters?

while i’m not sure how extract parent values typedarray, you’re able access them appropriate getters, e.g.:

public class myimageview extends imageview {      public myimageview(context context, attributeset attrs, int defstyle) {         super(context, attrs, defstyle);          final typedarray array = getcontext().obtainstyledattributes(attrs, r.styleable.whatever);         try {             // custom attributes here         } {             array.recycle();         }          // parent attributes         final drawable background = getbackground();         final drawable src = getdrawable();          // etc.     }  } 

it's not you're looking for, might help.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -