Code example for FragmentActivity

0
package com.commonsware.android.weather; 
 
import android.os.Bundle; 
import android.support.v4.app.FragmentActivity; 
 
public class WeatherDemo extends FragmentActivity { 
  @Override 
  public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
     
    if (savedInstanceState == null) { 
        getSupportFragmentManager() 
          .beginTransaction() 
          .add(android.R.id.content, new WeatherFragment()) 
          .commit(); 
    } 
  } 
}