Search Results

Search found 3 results on 1 pages for 'viewstub'.

Page 1/1 | 1 

  • In listview,Viewstub cannot be found after the previous one is inflate

    - by user2958132
    I am using some list item layout and in the item layout, there is a Viewstub where I want to put some image in.I don't have the source of list item layout and just know there are some TextViews and ViewStubs in it. My purpose is to find the ViewStub first and set my personal layout and play with it. However, some of the ViewStub cannot be found. public class TJAdapter extends CursorAdapter { .... public void bindView(View view, Context context, Cursor cursor) { ViewStub contentstub = (ViewStub)item.findViewById(R.id.content_stub); if (contentstub == null){ LOG.error("TJ,contentstub is null"); } else { LOG.error("TJ,contentstub is not null"); contentstub.setLayoutResource(R.layout.icon_image); View iconImage = contentstub.inflate(); } .... } public View newView(Context context, Cursor cursor, ViewGroup parent) { final View view = mInflater.inflate(R.layout.list_item, parent, false); bindView(view, context, cursor); } And the log output is like this: TJ,bindView is called TJ,contentstub is not null TJ,bindView is called TJ,contentstub is null TJ,bindView is called TJ,contentstub is not null TJ,bindView is called TJ,contentstub is not null TJ,bindView is called TJ,contentstub is null TJ,bindView is called TJ,contentstub is not null I spent a lot of time on it and have no idea why this happens. Can some body help?

    Read the article

  • How to set clickable and highlightable a ViewStub?

    - by Pentium10
    I have ViewStubs in my layout. If I set clickable and implement the OnClickListener this does work only on the root of the element. But the layout holds parent elements, and when I click on those the click is not recognized. How do I make a full row/view of ViewStub as whole to be clickable and highlightable like a ListView elements? Also what do I have to add to get that orange highlight?

    Read the article

  • How to set clickable and highlightable a View?

    - by Pentium10
    I have ViewStubs in my layout. If I set clickable and implement the OnClickListener this does work only on the root of the element. But the layout holds parent elements, and when I click on those the click is not recognized. How do I make a full row/view of ViewStub as whole to be clickable and highlightable like a ListView elements? Also what do I have to add to get that orange highlight?

    Read the article

1