/** * Copyright (C) 2013 Romain Guefveneu. * * This file is part of naonedbus. * * Naonedbus is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Naonedbus is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package net.naonedbus.activity.impl; import net.naonedbus.R; import net.naonedbus.fragment.impl.SettingsFragment; import android.annotation.TargetApi; import android.os.Build; import android.os.Bundle; import android.preference.PreferenceActivity; import com.actionbarsherlock.app.SherlockPreferenceActivity; import com.actionbarsherlock.view.MenuItem; public class SettingsActivity extends SherlockPreferenceActivity { @TargetApi(Build.VERSION_CODES.HONEYCOMB) @Override public void onCreate(final Bundle savedInstanceState) { getIntent().putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT, SettingsFragment.class.getName()); getIntent().putExtra(PreferenceActivity.EXTRA_NO_HEADERS, true); setContentView(R.layout.fragment_listview); getSupportActionBar().setDisplayHomeAsUpEnabled(true); super.onCreate(savedInstanceState); } @Override public boolean onOptionsItemSelected(final MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); return true; default: break; } return super.onOptionsItemSelected(item); } @Override protected boolean isValidFragment(final String fragmentName) { return true; } }