title: How do I use the deprecated getFragmentManager() in API Level 28?
body: <p>In API level 28, <code>getFragmentManager()</code> is deprecated. I have used this <code>FragmentActivity.getSupportFragmentManager()</code> is solution for this. But how can I implement that in my code.</p>
  
  <p><strong>Here my activity class code.</strong></p>
  
  <pre><code>  public class AttendanceActivity extends FragmentActivity {
  
   @Override
   protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.attendence_common_layout);
  
      if (findViewById(R.id.attendance_fragment_container) != null) {
          if (savedInstanceState != null) {
              return;
          }
          getFragmentManager().beginTransaction().add(R.id.attendance_fragment_container, new FragmentAttendance()).addToBackStack(null).commit();
      }
  }
  
  @Override
  public void onBackPressed() {
      super.onBackPressed();
      ActivityUtils.startActivity(this);
  
     }
  
   }
  </code></pre>