OK, one more thing you could try, and then I'm out of ideas. > > When you remove the last item from the grid view, call setFocusable(false) > and setFocusableInTouchMode(false) on it *before* calling requestFocus() > elsewhere. That way, it should *never* be able to get the focus back. When > you add items back to it, you can set them both to true again. > > Bear in mind, the problem might not be to do with focus - it might be that > - whether it has the focus or not - it insists on drawing the 'selected > item' no matter what - even if it has no selection, or no items to show. > It's possible that it doesn't like being empty, and expects at least one > item in it. > > A final possibility is to create a class that extends GridView, and > override onDraw(). When it has no items in it, do *not* call the superclass > version (as you would under normal circumstances). That should prevent it > from drawing the selection indicator - but it may also prevent it from > drawing the background (but you could compensate for that by manually > drawing the background only). > > The problem may simply be that you are using it in a way it is not > designed for (empty grid views) - so we are fighting the system. > > After that, you're going to have to hope someone else on here has some > suggestions...
Hey Jason, the problem got solved (very easily). There was no need to do those lot of things you suggested me. My problem just solved by doing this little modification: 1) Refreshing the adapter on drag and drop. 2) And then setting the adapter to my gridview. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en