开发者

Android: Awkward behavior when updating GridView contents

I am building an android app for HoneyComb tablet, and there is a very weird little detail.

The app shows a ListView and a GridView in the application, and when the user selects an item from the ListView (on the left), the GridView contents get updated. I have two types of items in the GridView: Plain Text, and Images.

Everything works as expected when I am displaying plain text, but once i display images once(which works perfectly) and then switch to any othe开发者_开发知识库r item, the gridview clears, and has nothing in it. If i lock the device and unlock it again, everything continues to work. Here is a snippet of code i use to change the contents:

h.post(new Runnable()
{
    public void run()
    {
        gridView.setAdapter(slidesAdapter)
    }
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜