Code example for FragmentActivity

Methods: getPackageName, getResources, getSupportFragmentManager, setTitle

0
		if(OKUser.getCurrentUser() != null){ 
			Intent showProfile = new Intent(OKLeaderboardsActivity.this, OKUserProfileActivity.class);
			startActivity(showProfile);
		} 
		else{ 
			Intent loginIntent = new Intent(OKLeaderboardsActivity.this, OKLoginActivity.class);
			startActivity(loginIntent);
		} 
	} 
 
	private void showLeaderboardsList() 
	{ 
		OKLog.d("Show leaderboards list"); 
 
		if(leaderboardsFragment == null) {
			leaderboardsFragment = new OKLeaderboardsFragment();
		} 
 
		if(!leaderboardsFragment.isVisible()){
 
			android.support.v4.app.FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
			ft.replace(android.R.id.content, leaderboardsFragment, LEADERBOARD_FRAGMENT_TAG);
			ft.commit();
		} 
 
		this.setTitle(leaderboardTitleID);
	} 
 
	private void showAchievementsList() 
	{ 
		OKLog.d("Show achievements list"); 
 
		if(achievementsFragment == null) {
			achievementsFragment = new OKAchievementsFragment();
		} 
 
		if(!achievementsFragment.isVisible()) {
			android.support.v4.app.FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
			ft.replace(android.R.id.content, achievementsFragment, ACHIEVEMENT_FRAGMENT_TAG);
			ft.commit();
		} 
 
		this.setTitle(achievementsTitleID);
	}