whirlwin
whirlwin

Reputation: 16521

Disable Gallery View

I have a problem disabling views from my Gallery in my Android application. Nothing seems to happen with the View when I click it. Here is my onItemClick(...) method:

 @Override
 public void onItemClick(AdapterView<?> adapterView, View view,
   int position, long id) {
        view.setEnabled(false);
    }

I have also tried setVisibility(...) What am I missing?

Thanks in advance.

Upvotes: 0

Views: 333

Answers (1)

Julian Vogels
Julian Vogels

Reputation: 688

If you want to set your view invisible, try this little piece of code:

view.setVisibility(View.GONE);

This sets the view invisible and i think you can't focus it anymore. But if you're working within a grid, there will be a gap left behind.

Upvotes: 2

Related Questions