Code example for FragmentActivity

0
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),  
									new DateMinusDateFragment()}; 
	} 
 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE