/*
* Copyright (C) 2012-2015 asksven
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.asksven.betterbatterystats;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.widget.Toolbar;
import com.asksven.betterbatterystats.R;
/**
* Demonstrates combining a TabHost with a ViewPager to implement a tab UI that
* switches between tabs and also allows the user to perform horizontal flicks
* to move between the tabs.
*/
public class PackageInfoActivity extends BaseActivity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
// setTheme(SampleList.THEME); //Used for theme switching in samples
super.onCreate(savedInstanceState);
setContentView(R.layout.package_info);
if (savedInstanceState == null) {
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
PackageInfoTabsFragment fragment = new PackageInfoTabsFragment();
transaction.replace(R.id.sample_content_fragment, fragment);
transaction.commit();
}
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle(getString(R.string.label_packageinfo));
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayUseLogoEnabled(false);
}
}