updated example to use fragments and fixed some (not all) deprecated api
calls.