This code example shows how to use the following methods:getActivity, onAttach

super.onCreate(savedInstanceState);
}
@Override
public void onAttach(Activityactivity) {
super.onAttach(activity);
// This is the fragment that launches the Janrain sharing dialogue
// If Android restarts the app and restores the activity stack with this fragment
// on top then the Janrain library needs to be re-initialized.
QuickShare.getInstance().initJREngage(getActivity());
}
@Override
public View onCreateView(LayoutInflaterinflater, ViewGroupcontainer, BundlesavedInstanceState) {
if (container == null) {
// We have different layouts, and in one of them this
// fragment's containing frame doesn't exist. The fragment
// may still be created from its saved state, but there is
// no reason to try to create its view hierarchy because it