Android FragmentActivity - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android FragmentActivity class.

This code example shows how to use the following methods:
/** 
 * This demonstrates how you can implement switching between the tabs of a 
 * TabHost through fragments.  It uses a trick (see the code below) to allow 
 * the tabs to switch between fragments instead of simple views. 
 */ 
public class FragmentTabs extends FragmentActivity implements LocationListener{
    TabHost mTabHost;
    TabManager mTabManager;
 
    @Override 
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
 
        setContentView(R.layout.fragment_tabs); 
        mTabHost = (TabHost)findViewById(android.R.id.tabhost);
        mTabHost.setup();
        mTabHost.getTabWidget().setDividerDrawable(R.drawable.tab_divider);
        mTabManager = new TabManager(this, mTabHost, R.id.realtabcontent);
         
        setupTab("Dashboard", DashFrag.class); 
10
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
package net.avh4.tasks.android; 
 
import android.os.Bundle; 
import android.support.v4.app.FragmentActivity; 
import net.avh4.ide.example.net.avh4.tasks.android.R; 
 
/** 
 * An activity representing a list of Tasks. 
 */ 
public class TaskListActivity extends FragmentActivity { 
 
    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
        super.onCreate(savedInstanceState); 
        setContentView(R.layout.activity_task_list); 
    } 
} 

10
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
package mobi.tongari.mokutan.ui; 
 
import mobi.tongari.mokutan.R; 
import android.support.v4.app.FragmentActivity; 
 
import com.google.android.gms.maps.SupportMapFragment; 
import com.googlecode.androidannotations.annotations.EActivity; 
import com.googlecode.androidannotations.annotations.FragmentById; 
 
@EActivity(R.layout.activity_test_fragment) 
public class TestFragmentActivity extends FragmentActivity { 
 
@FragmentById 
ExMapFragment fragment1; 
	 
@FragmentById 
SupportMapFragment mapFragment; 
	 
} 

10
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
package csci498.bybeet.lunchlist; 
 
import android.os.Bundle; 
import android.support.v4.app.FragmentActivity; 
 
public class DetailForm extends FragmentActivity { 
 
	@Override 
	public void onCreate (Bundle savedInstanceState) { 
		super.onCreate(savedInstanceState); 
		setContentView(R.layout.detail_activity); 
	} 
	 
	@Override 
	public void onResume(){ 
		super.onResume(); 
		 
		String restaurantId = getIntent().getStringExtra(LunchList.ID_EXTRA); 
		 
		if(restaurantId != null){ 
10
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
package com.example.greenways;  
 
import android.os.Bundle; 
import android.support.v4.app.FragmentActivity; 
import android.view.Gravity; 
import android.view.Menu; 
import android.widget.TextView; 
 
public class Weather extends FragmentActivity  
{ 
	@Override 
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.weather); 
        TextView v = (TextView) findViewById(android.R.id.title);
        v.setGravity(Gravity.CENTER);
        v.setTextSize(17);
    } 
 
    @Override 

10
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
package helloworld.android.basic.datecalculator; 
 
import android.os.Bundle; 
import android.support.v4.app.Fragment; 
import android.support.v4.app.FragmentActivity; 
import android.support.v4.app.FragmentTransaction; 
import android.util.Log; 
import android.widget.ListView; 
 
public class CalculatorActivity extends FragmentActivity implements OperationListFragment.ItemEventListener { 
	private static final String TAG = "CalculatorActivity";
	Fragment[] operFrags;
	private int currentPosition = ListView.INVALID_POSITION;
	 
	@Override 
	protected void onCreate(Bundle savedState) {
		super.onCreate(savedState);
		setContentView(R.layout.activity_operation_menu); 
		operFrags = new Fragment[]{ new DateAndDaysFragment().setOperation(Operation.PLUS), 
									new DateAndDaysFragment().setOperation(Operation.MINUS),  

10
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
 * Mock Activity to demonstrate the basic fragment based navigation using tabs. 
 *  
 * @author Sascha Moecker 
 *  
 */ 
public class MockSlidingTabActivity extends FragmentActivity { 
 
	private MockSectionsPagerAdapter mSectionsPagerAdapter; 
	private ViewPager mViewPager; 
 
	@Override 
	protected void onCreate(Bundle savedInstanceState) { 
		super.onCreate(savedInstanceState); 
		setContentView(R.layout.activity_mocksslidingtab); 
 
		mSectionsPagerAdapter = new MockSectionsPagerAdapter(this, 
				getSupportFragmentManager()); 
 
		mViewPager = (ViewPager) findViewById(R.id.pager); 
		mViewPager.setAdapter(mSectionsPagerAdapter); 
10
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
package com.calebgo.meadlog; 
 
import android.content.Intent; 
import android.os.Bundle; 
import android.support.v4.app.FragmentActivity; 
import android.support.v4.app.NavUtils; 
import android.view.MenuItem; 
 
public class BrewDetailActivity extends FragmentActivity { 
 
    @Override 
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_brew_detail); 
 
        getActionBar().setDisplayHomeAsUpEnabled(true); 
 
        if (savedInstanceState == null) {
            Bundle arguments = new Bundle();
            arguments.putString(BrewDetailFragment.ARG_ITEM_ID,

10
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
package com.ponchochap.dimes; 
 
import android.annotation.TargetApi; 
import android.os.Build; 
import android.os.Bundle; 
import android.support.v4.app.FragmentActivity; 
import android.view.Menu; 
 
public class Controller extends FragmentActivity { 
 
	@TargetApi(Build.VERSION_CODES.HONEYCOMB) 
	@Override 
	protected void onCreate(Bundle savedInstanceState) { 
		super.onCreate(savedInstanceState); 
		setContentView(R.layout.activity_controller); 
		// Hide action bar 
		getActionBar().hide(); 
		// Make a fragment manager and transaction 
		android.support.v4.app.FragmentManager fragmentManager = getSupportFragmentManager(); 
		android.support.v4.app.FragmentTransaction ft = fragmentManager 

10
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
 
import static android.support.v4.app.Watson.OnCreateOptionsMenuListener; 
import static android.support.v4.app.Watson.OnOptionsItemSelectedListener; 
import static android.support.v4.app.Watson.OnPrepareOptionsMenuListener; 
 
public class SherlockFragment extends Fragment implements OnCreateOptionsMenuListener, OnPrepareOptionsMenuListener, OnOptionsItemSelectedListener {
    private SherlockFragmentActivity mActivity;
 
    public SherlockFragmentActivity getSherlockActivity() { 
        return mActivity;
    } 
 
    @Override 
    public void onAttach(Activity activity) {
        if (!(activity instanceof SherlockFragmentActivity)) {
            throw new IllegalStateException(getClass().getSimpleName() + " must be attached to a SherlockFragmentActivity.");
        } 
        mActivity = (SherlockFragmentActivity)activity;
 
        super.onAttach(activity);
10
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Android FragmentActivity Methods: