Best code examples for Fragment getActivity method (android.app.Fragment.getActivity)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Fragment getActivity method.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Fragment getActivity examples from Open Source projects
This code example shows how to use the following methods: getActivity
28:	((StateChangedListener) getActivity()).changedState(state); 
Full Snippet Info
10
CodeRank
This code example shows how to use the following methods: getActivity, getResources
29:	int color = getResources().getColor(mColorRes); 
-
31:	RelativeLayout v = new RelativeLayout(getActivity()); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getActivity, onActivityCreated, setRetainInstance
39:	super.onActivityCreated(savedInstanceState); 
-
41:	setRetainInstance(true); 
42:	getActivity().getApplicationContext() 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getActivity, getView, onActivityCreated
100:	super.onActivityCreated(savedInstanceState); 
-
140:	setListShown(true, getView().getWindowToken() != null); 
-
261:	getActivity(), android.R.anim.fade_in)); 
-
267:	getActivity(), android.R.anim.fade_out)); 
-
284:	View root = getView(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: getActivity, onActivityCreated, startActivity
32:	super.onActivityCreated(savedInstanceState); 
-
34:	SharedPreferences prefs = SettingsActivity.getSettings(getActivity()); 
-
36:	Intent browseData = new Intent(getActivity(), BrowsingActivity.class); 
-
39:	startActivity(browseData); 
Full Snippet Info
10
CodeRank
This code example shows how to use the following methods: getActivity
66:	return new TextView(getActivity()); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getActivity, getChildFragmentManager
39:	return(new SampleAdapter(getActivity(), getChildFragmentManager())); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getActivity, onDestroy
48:	getActivity().getApplicationContext().unbindService(this); 
-
51:	super.onDestroy(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getActivity, getArguments, onCreate
47:	super.onCreate(savedInstanceState); 
-
49:	if (getArguments().containsKey(ARG_ITEM_ID)) { 
-
51:	mItem = DatabaseHandler.getInstance(getActivity()).getPerson(getArguments().getLong(ARG_ITEM_ID)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getActivity
40:	((DynamicFragmentsDemoActivity)getActivity()).showOther(v); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getActivity
30:	Toast.makeText(getActivity(), FRAGMENT_TOAST_MESSAGE, Toast.LENGTH_SHORT).show(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getActivity, onContextItemSelected
158:	long[] list = MusicUtils.getSongListForGenre(getActivity(), 
-
160:	MusicUtils.playAll(getActivity(), list, 0); 
-
165:	return super.onContextItemSelected(item); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getActivity, onDestroy
88:	super.onDestroy(); 
-
91:	mLocalActivityManager.dispatchDestroy(getActivity().isFinishing()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getActivity
44:	final Activity activity = getActivity(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getActivity, onActivityCreated
83:	super.onActivityCreated(savedInstanceState); 
-
87:	if (ImageDetailActivity.class.isInstance(getActivity())) { 
88:	mImageFetcher = ((ImageDetailActivity) getActivity()).getImageFetcher(); 
-
93:	if (OnClickListener.class.isInstance(getActivity()) && Utils.hasHoneycomb()) { 
94:	mImageView.setOnClickListener((OnClickListener) getActivity()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getActivity, getView, onResume, toString
67:	super.onResume(); 
68:	getActivity().setTitle(toString()); 
69:	getView().setOnClickListener(new OnClickListener() { 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getActivity, getArguments, onCreate
47:	super.onCreate(savedInstanceState); 
-
49:	if (getArguments().containsKey(ARG_ITEM_ID)) { 
-
51:	mItem = DatabaseHandler.getInstance(getActivity()).getPersonItem(getArguments().getLong(ARG_ITEM_ID)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getActivity
134:	final Activity a = fragment.getActivity(); 
-
136:	((FragmentInstallable) a).onInstallFragment(fragment); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getActivity, onStart
52:	super.onStart(); 
-
55:	Window window = getActivity().getWindow(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getActivity, getArguments, getId
145:	return getArguments().getInt("index", 0); 
-
153:	if (getActivity() instanceof StoryDetailActivity) { 
154:	((StoryDetailActivity) getActivity()).startWaiting(); 
-
159:	mQuickShare.getJREngage().showSocialPublishingFragment(jra, getActivity(), getId(), true, 
-
162:	mQuickShare.getJREngage().showSocialPublishingDialog(getActivity(), jra); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getActivity, getArguments, onCreate
45:	super.onCreate(savedInstanceState); 
-
51:	mLocalActivityManager = new LocalActivityManager(getActivity(), true); 
-
54:	Intent mapActivityIntent = new Intent(getActivity(), TandemActivitiesMapActivity.class); 
55:	Bundle mapActivityStartupBundle = this.getArguments(); 
-
61:	((TandemActivitiesActivityInterface)mLocalActivityManager.getActivity("mapActivity")).setContainingFragmentActivity(getActivity()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getActivity, getView, onViewCreated
146:	super.onViewCreated(view, savedInstanceState); 
-
188:	setListShown(true, getView().getWindowToken() != null); 
-
293:	getActivity(), android.R.anim.fade_out)); 
-
295:	getActivity(), android.R.anim.fade_in)); 
-
305:	getActivity(), android.R.anim.fade_in)); 
-
307:	getActivity(), android.R.anim.fade_out)); 
-
328:	View root = getView(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getActivity
44:	Activity a = getActivity(); 
-
50:	super(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getActivity
46:	mWebView = new WebView(getActivity()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getActivity, onStart
52:	super.onStart(); 
53:	spiceManager.start(getActivity()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getActivity, getArguments, onActivityCreated
61:	super.onActivityCreated(savedInstanceState); 
62:	mFeedObserver = new ContentObserver(new Handler(getActivity().getMainLooper())) { 
-
68:	mFeedUri = getArguments().getParcelable(ARG_FEED_URI); 
69:	ContentResolver resolver = getActivity().getContentResolver(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getActivity, onResume, toString
94:	super.onResume(); 
95:	getActivity().setTitle(toString()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getActivity, onCreate
10:	super.onCreate(savedInstanceState); 
11:	GraphRetriever.from(getActivity()).inject(this); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getActivity, getView, onViewCreated
156:	super.onViewCreated(view, savedInstanceState); 
-
198:	setListShown(true, getView().getWindowToken() != null); 
-
303:	getActivity(), android.R.anim.fade_out)); 
-
305:	getActivity(), android.R.anim.fade_in)); 
-
315:	getActivity(), android.R.anim.fade_in)); 
-
317:	getActivity(), android.R.anim.fade_out)); 
-
338:	View root = getView(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getActivity, onCreate
22:	super.onCreate(bundle); 
23:	Activity activity = getActivity(); 
-
25:	mTaskExecutor = ((TaskActivity) getActivity()).mTaskExecutor; 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getActivity
14:	TextView tv = new TextView(this.getActivity()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getActivity
36:	if( null != getActivity() ) { 
37:	return (MainApplication) getActivity().getApplicationContext(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getActivity, onActivityCreated
59:	super.onActivityCreated(savedInstanceState); 
-
61:	adapter = new SimpleAdapter(getActivity(), demos, android.R.layout.simple_list_item_1, new String[]{"label"}, 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getActivity, onActivityResult
59:	super.onActivityResult(requestCode, resultCode, data); 
60:	sessionTracker.getSession().onActivityResult(this.getActivity(), requestCode, resultCode, data); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getActivity, onActivityCreated
63:	super.onActivityCreated(savedInstanceState); 
64:	biller = new Biller(getActivity()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getActivity, getArguments, onCreate
27:	super.onCreate(paramBundle); 
28:	String str1 = getArguments().getString("com.instagram.android.fragment.SimpleWebViewFragment.ARGUMENT_URL"); 
-
30:	if (getArguments().getBoolean("com.instagram.android.fragment.SimpleWebViewFragment.ARGUMENT_LOAD_SAME_HOST")) 
-
32:	this.mWebView = new WebView(getActivity()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getActivity, onStart, startActivity
17:	super.onStart(); 
18:	context = getActivity(); 
-
21:	startActivity(i); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getActivity, getLoaderManager, onActivityCreated
80:	super.onActivityCreated(savedInstanceState); 
81:	activity = getActivity(); 
-
85:	getLoaderManager().initLoader(0, null, this); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getActivity, onCreate, setHasOptionsMenu
61:	super.onCreate(savedInstanceState); 
62:	setHasOptionsMenu(true); 
63:	AnalyticsUtils.getInstance(getActivity()).trackPageView("/Map"); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getActivity, getLoaderManager, onActivityCreated
93:	super.onActivityCreated(savedInstanceState); 
-
95:	mApplication = (SecretDiaryApplication) getActivity().getApplication(); 
-
98:	getLoaderManager().initLoader(0, null, this); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getActivity, onActivityCreated
87:	super.onActivityCreated(savedInstanceState); 
-
92:	if (ImageDetailActivity.class.isInstance(getActivity())) { 
93:	mImageWorker = ((ImageDetailActivity) getActivity()) 
-
99:	if (OnClickListener.class.isInstance(getActivity()) 
-
101:	mImageView.setOnClickListener((OnClickListener) getActivity()); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getActivity, getView, onViewCreated
162:	super.onViewCreated(view, savedInstanceState); 
-
205:	setGridShown(true, (getView().getWindowToken() != null)); 
-
310:	getActivity(), android.R.anim.fade_out)); 
-
312:	getActivity(), android.R.anim.fade_in)); 
-
322:	getActivity(), android.R.anim.fade_in)); 
-
324:	getActivity(), android.R.anim.fade_out)); 
-
345:	View root = getView(); 
Full Snippet Info
5
CodeRank
Related Fragment getActivity Questions & Answers:
Other Fragment getActivity Examples
11:	
12:	        // Create a new instance of DatePickerDialog and return it
13:	        return new DatePickerDialog(getActivity(), this, year, month, day);
14:	    }
15:

Read More

10:	
11:	        // Create a new instance of TimePickerDialog and return it
12:	        return new TimePickerDialog(getActivity(), this, hour, minute,
13:	                DateFormat.is24HourFormat(getActivity()));
14:	    }
-
11:	        // Create a new instance of TimePickerDialog and return it
12:	        return new TimePickerDialog(getActivity(), this, hour, minute,
13:	                DateFormat.is24HourFormat(getActivity()));
14:	    }
15:

Read More

getActivity Method Overview
Return the Activity this fragment is currently associated with.
See Also