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; //from w w w. ja v a 2 s. c o m import android.app.Activity; import android.graphics.Bitmap; import android.os.Build; import android.os.Bundle; import android.support.v4.app.NavUtils; import android.view.*; import android.widget.ImageView; import android.widget.TextView; /** * 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/>. */ //http://www.aktivitetsbanken.se/aktivitetsbanken/images/1/14/Handalfabet.JPG /** * The AlphabetHelpActivity displays the swedish sign alphabet and was meant to * start a slideshow of the alphabet if the start button wa pushed, but that * functionality is removed for the time being * * @author : Grupp02 * @version : 2012-10-21, v1.0 */ public class AlphabetHelpActivity extends Activity { private Bitmap img; private ImageView userImg; private TextView userName; private TextView userStatus; // private Button start; /** * The onCreate method initializes the start button for the slideshow. * * @param savedInstanceState * : the save state for the activity */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_alphabet_help); // 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 ); } // User Image userImg = (ImageView) findViewById(R.id.userpic); img = (Bitmap) (getIntent().getExtras().getParcelable("userImg")); userImg.setImageBitmap(img); userStatus = (TextView) findViewById(R.id.textView1); userStatus.setText(getIntent().getStringExtra("User")); // Displays the username userName = (TextView) findViewById(R.id.textView2); userName.setText(getIntent().getStringExtra("Name")); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_alphabet_help, 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); } @Override public void onSaveInstanceState(Bundle savedInstanceState) { // Save name, user status, and user picture savedInstanceState.putString("Name", userName.getText().toString()); savedInstanceState.putString("status", userStatus.getText().toString()); savedInstanceState.putParcelable("picture", img); // Always call the superclass so it can save the view hierarchy state super.onSaveInstanceState(savedInstanceState); } @Override public void onRestoreInstanceState(Bundle savedInstanceState) { // Always call the superclass so it can restore the view hierarchy super.onRestoreInstanceState(savedInstanceState); // Restore name, user status, and user picture userName.setText(savedInstanceState.getString("Name")); userStatus.setText(savedInstanceState.getString("status")); img = savedInstanceState.getParcelable("picture"); userImg.setImageBitmap(img); } }