-4

I am creating an android app where i am required to do the following: start of next activity upon clicking buttons in android gridview.my question is as follows:

  1. can we create buttons in android grid view XML??
  2. how can we link these buttons with the java part using intents?

step 1 step 2

manish
  • 1
  • 2
  • what you want to do..?? – Nils Nov 27 '15 at 07:49
  • please show the code you used to create the grid – carstenbaumhoegger Nov 27 '15 at 08:04
  • Why do you want to use Buttons? You can use clickable ImageViews. And you don't need to start an Intent. Just swap your current Fragment. – Phantômaxx Nov 27 '15 at 09:00
  • @NilsPatel: Suppose i have the first item samsumg galaxy( as shown above).When i click on it, i want to get some basic information of (say its properties like memory,camera etc) however,the information should be found in the next activity and the same procedure follows on clicking different Imageviews. How can we do this?? Maybe by intents?? and do how do it in the xml also? – manish Nov 27 '15 at 11:35
  • @MF6265 Here it is:[link] (http://www.androidbegin.com/tutorial/android-simple-gridview-tutorial/) ..please check my above comment – manish Nov 27 '15 at 11:37
  • @FrankN.Stein: please check my above comment thnks:) – manish Nov 27 '15 at 11:37
  • 1
    @manish have you try any code..??? are you doing offline ..??? how you want do this?? by database or static.??? – Nils Nov 27 '15 at 11:37
  • @NilsPatel: [link](http://www.androidbegin.com/tutorial/android-simple-gridview-tutorial) i ran this code in android studio...now i want to modify it by my above requirements. i do not not need to do it by database..actually i want that in my next activity..please see my above design:(its handwritten:step1 and step2) – manish Nov 27 '15 at 12:05
  • well @manish please can upload your code you have do until now, so we can help you to do better. – Nils Nov 27 '15 at 12:16

1 Answers1

1

By using of Button Adapter you can put buttons in grid view.

  1. To create a new ButtonAdapter class that extends the BaseAdapter class.

  2. Later set your customized ButtonAdapter inside the grid view.

    Follow this link

Community
  • 1
  • 1
  • thank you..what if:Suppose i have the first item samsumg galaxy( as shown above).When i click on it, i want to get some basic information of (say its properties like memory,camera etc) however,the information should be found in the next activity and the same procedure follows on clicking different Imageviews. How can we do this?? Maybe by intents?? and do how do it in the xml also? – manish Nov 27 '15 at 11:39