Replace the contents of this file with the following: package com.raywenderlich.babybookcase; import android.content. When your activity instance is destroyed and recreated, the state of the layout is restored to its previous state with no code required by you.This means that to make the selections behave correctly, you need to save the selection information yourself.
Now we want to edit the department for selected employee.
If you’re familiar with Android’s is a useful component for constructing easy-to-browse lists.
And since grids are everywhere these days (notably in the Instagram app) it’s a necessary skill.
So now we added a drop-down list under edit template, which will display only on edit mode. This is a simple task, we made a common function `gv Bind()` which binds our Gridview control with data.
On page load will call this function, and now whenever the page gets load, function gv Bind() gets call and data gets display. Now we are at the main part of this article .i.e we are going to bind dropdown list in Gridview which we placed under edit template.