Android: In Gridview how do I make the images clickable?

You may want to consider using the ImageButton class to do this for you. Its a button but instead of having a boring gray gradient you place an image there instead! Andriod ImageButton Docs From there you are free to use a click listener just like you would with a regular button.

Just add a listener to the GridView GridView gridView = (GridView) findViewById(R.id. Gridview); gridView. SetAdapter(new ImageAdapter()); gridView.

SetOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView parent, View v, int position, long id) { data. AktueltBilledeNr = position; Toast. MakeText(getBaseContext(), "Viser billede " + (position + 1), Toast.

LENGTH_SHORT).show(); finish(); //startActivity(new Intent(Resultatsoversigt_akt. This, Teoriproeveaktivitet2. Class)); } }).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions