• Post Reply Bookmark Topic Watch Topic
  • New Topic

setChoiceMode in GridView with custom ArrayAdapter does not work  RSS feed

Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recently want to have my custom ArrayAdapter.
I googled and find some samples, and i did my ArrayAdapter like this.

(Car is a class with some fields)

And i made a custom layout for this Adapter with two TextView.
Here is the XML Layout for this.

OK. I want to display Above Layout as a row to a GridView.
So i made my Main Layout as below :

I make a simple GridView.

In my MainActivity and onCreate method :

OK, it display my new Car properly in GridView.
But when i do setChoiceMode in my GridView, it does not act.
Previously i setChoiceMode in simple GridView and it effected.
What should i do?
when i select, it effect, and i cant return the value of selected item in GridView.
But in view setChoiceMode does not work.
This will take every ounce of my mental strength! All for a tiny ad:
Thread Boost - a very different sort of advertising
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!