MyTetra Share
Делитесь знаниями!
CrimeActivity.java
17.04.2017
10:01
Раздел: Android - books - AndroidProgramming2e - 8 Макеты и виджеты
CrimeActivity.java

CrimeActivity.java

package com.bignerdranch.android.criminalintent; 
 
import android.os.Bundle; 
import android.support.v4.app.Fragment; 
import android.support.v4.app.FragmentActivity; 
import android.support.v4.app.FragmentManager; 
 
 
public class CrimeActivity extends FragmentActivity { 
 
    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
        super.onCreate(savedInstanceState); 
        setContentView(R.layout.activity_crime); 
 
        FragmentManager fm = getSupportFragmentManager(); 
        Fragment fragment = fm.findFragmentById(R.id.fragment_container); 
 
        if (fragment == null) { 
            fragment = new CrimeFragment(); 
            fm.beginTransaction() 
                    .add(R.id.fragment_container, fragment) 
                    .commit(); 
        } 
    } 
 
} 

 
MyTetra Share v.0.52
Яндекс индекс цитирования