Back to project page Handalfabet.
The source code is released under:
GNU General Public License
If you think the Android project Handalfabet listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.example.android; /*w w w . jav a 2 s. c om*/ import java.util.List; import android.app.Activity; import android.content.Context; import android.os.Build; import android.os.Bundle; import android.support.v4.app.NavUtils; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.widget.ListView; /** * Copyright? 2012, Grupp02 * * This file is part of Handalfabetet. * * Handalfabetet 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. * * Handalfabetet 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 Handalfabetet. If not, see <http://www.gnu.org/licenses/>. */ /** * The DisplayHighscoreActvity class is used to display the Highscore screen. * * @author : Grupp02 * @version : 2012-10-19, v1.0 */ public class DisplayHighscoreActivity extends Activity { private ListView listView; private List<User> list; private DatabaseHelper db; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_display_highscore); db = new DatabaseHelper(this); // Make sure we're running on Honeycomb or higher to use ActionBar APIs if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { // getActionBar().setDisplayHomeAsUpEnabled(true); } listView = (ListView) findViewById(R.id.list_highscore); list = db.getAllUsers(); // Create ArrayAdapter using the user list. HighScoreArrayAdapter adapter = new HighScoreArrayAdapter(this, R.layout.show_user_highscore, list); adapter.inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); listView.setAdapter(adapter); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_display_highscore, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: NavUtils.navigateUpFromSameTask(this); return true; } return super.onOptionsItemSelected(item); } }