View Javadoc

1   /***
2    *     Ambient - A music player for the Android platform
3    Copyright (C) 2007 Martin Vysny
4    
5    This program is free software: you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation, either version 3 of the License, or
8    (at your option) any later version.
9    
10   This program is distributed in the hope that it will be useful,
11   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   GNU General Public License for more details.
14  
15   You should have received a copy of the GNU General Public License
16   along with this program.  If not, see <http://www.gnu.org/licenses/>.
17   */
18  
19  package sk.baka.ambient.activity;
20  
21  import sk.baka.ambient.AmbientApplication;
22  import sk.baka.ambient.R;
23  import android.app.Activity;
24  import android.os.Bundle;
25  import android.widget.TextView;
26  
27  /***
28   * Shows the About dialog.
29   * 
30   * @author Martin Vysny
31   */
32  public final class AboutActivity extends Activity {
33  	@Override
34  	protected void onCreate(Bundle icicle) {
35  		super.onCreate(icicle);
36  		setContentView(R.layout.aboutactivity);
37  		final TextView appNameText = (TextView) findViewById(R.id.aboutAppName);
38  		final String appName = getAppName();
39  		appNameText.setText(appName);
40  	}
41  
42  	private String getAppName() {
43  		final StringBuilder b = new StringBuilder();
44  		b.append(getString(R.string.app_name));
45  		b.append(" v");
46  		b.append(AmbientApplication.getInstance().getVersion());
47  		return b.toString();
48  	}
49  }