
Untitled
By: a guest on
Aug 6th, 2012 | syntax:
None | size: 0.73 KB | hits: 9 | expires: Never
Check if a view belongs to a linearlayout or not
LinearLayout layoutWithButton = (LinearLayout)findViewById(R.id.layout_with_button);
ImageButton buttonInLayout = (ImageButton)layoutWithButton.findViewById(R.id.button_in_layout);
if (buttonInLayout != null) {
// Found
}
View parent = (View)mContent.getParent();
if (parent instanceof LinearLayout) {
// do stuff
}
LinearLayout contentLayoutAddressPostal = (LinearLayout)findViewById(R.id.se_contentAdressPostal);
ImageButton imbtRemoveAddress2 = (ImageButton)findViewById(R.id.sfsp2_ivHide);
if(imbtRemoveAddress2.getParent()==contentLayoutAddressPostal){
imbtRemoveAddress2.performClick();
............................