Skip to content

Commit 0d32b31

Browse files
committed
updates
1 parent ea8212b commit 0d32b31

21 files changed

Lines changed: 248 additions & 30 deletions

File tree

com.vogella.android.florencedemo/AndroidManifest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
<application
1010
android:icon="@drawable/ic_launcher"
11-
android:label="@string/app_name" >
11+
android:label="@string/app_name"
12+
android:theme="@android:style/Theme.Holo.Light"
13+
>
1214
<activity
1315
android:name=".MainActivity"
1416
android:label="@string/app_name" >
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
3-
<item android:id="@+id/menuitem1" android:title="Browse"></item>
4-
<item android:id="@+id/menuitem2" android:title="Preferences"></item>
5-
3+
4+
<item android:id="@+id/menuitem1" android:title="Hello">
5+
</item>
6+
<item android:id="@+id/menuitem2" android:title="Text">
7+
</item>
8+
<item android:id="@+id/menuitem3" android:title="Preferences">
9+
</item>
610

711
</menu>

com.vogella.android.florencedemo/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<resources>
33

44
<string name="hello">Hello World, MainActivity!</string>
5-
<string name="app_name">Florence Demo</string>
5+
<string name="app_name">Demo</string>
66

77
</resources>
Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,26 @@
11
package com.vogella.android.florencedemo;
22

3-
import android.app.Activity;
4-
import android.content.Intent;
5-
import android.net.Uri;
3+
import android.app.ListActivity;
64
import android.os.Bundle;
75
import android.view.Menu;
8-
import android.view.MenuItem;
6+
import android.widget.ArrayAdapter;
97

10-
public class MainActivity extends Activity {
8+
public class MainActivity extends ListActivity {
119
/** Called when the activity is first created. */
1210
@Override
1311
public void onCreate(Bundle savedInstanceState) {
1412
super.onCreate(savedInstanceState);
15-
setContentView(R.layout.main);
13+
String[] values = new String[] { "Android", "iPhone", "WindowsMobile",
14+
"Blackberry", "WebOS", "Ubuntu", "Windows7", "Max OS X",
15+
"Linux", "OS/2" };
16+
ArrayAdapter adapter = new ArrayAdapter<String>(this,
17+
android.R.layout.simple_list_item_1, values);
18+
setListAdapter(adapter);
1619
}
1720

1821
@Override
1922
public boolean onCreateOptionsMenu(Menu menu) {
2023
getMenuInflater().inflate(R.menu.mymenu, menu);
2124
return true;
2225
}
23-
24-
@Override
25-
public boolean onOptionsItemSelected(MenuItem item) {
26-
switch (item.getItemId()) {
27-
case R.id.menuitem1:
28-
Intent intent = new Intent(Intent.ACTION_VIEW,
29-
Uri.parse("http://www.vogella.com"));
30-
startActivity(intent);
31-
break;
32-
case R.id.menuitem2:
33-
intent = new Intent(this, MyPreferences.class);
34-
startActivity(intent);
35-
break;
36-
37-
default:
38-
break;
39-
}
40-
return super.onOptionsItemSelected(item);
41-
}
4226
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="src" path="gen"/>
5+
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
6+
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
7+
<classpathentry kind="output" path="bin/classes"/>
8+
</classpath>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>com.vogella.android.florencedemo_shortcut</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.jdt.core.javabuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
</buildSpec>
29+
<natures>
30+
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
31+
<nature>org.eclipse.jdt.core.javanature</nature>
32+
</natures>
33+
</projectDescription>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.vogella.android.florencedemo"
4+
android:versionCode="1"
5+
android:versionName="1.0" >
6+
7+
<uses-sdk android:minSdkVersion="15" />
8+
9+
<application
10+
android:icon="@drawable/ic_launcher"
11+
android:label="@string/app_name" >
12+
<activity
13+
android:name=".MainActivity"
14+
android:label="@string/app_name"
15+
android:theme="@android:style/Theme.Holo.Light"
16+
>
17+
<intent-filter>
18+
<action android:name="android.intent.action.MAIN" />
19+
20+
<category android:name="android.intent.category.LAUNCHER" />
21+
</intent-filter>
22+
</activity>
23+
</application>
24+
25+
</manifest>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# To enable ProGuard in your project, edit project.properties
2+
# to define the proguard.config property as described in that file.
3+
#
4+
# Add project specific ProGuard rules here.
5+
# By default, the flags in this file are appended to flags specified
6+
# in ${sdk.dir}/tools/proguard/proguard-android.txt
7+
# You can edit the include path and order by changing the ProGuard
8+
# include property in project.properties.
9+
#
10+
# For more details, see
11+
# http://developer.android.com/guide/developing/tools/proguard.html
12+
13+
# Add any project specific keep options here:
14+
15+
# If your project uses WebView with JS, uncomment the following
16+
# and specify the fully qualified class name to the JavaScript interface
17+
# class:
18+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19+
# public *;
20+
#}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This file is automatically generated by Android Tools.
2+
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3+
#
4+
# This file must be checked in Version Control Systems.
5+
#
6+
# To customize properties used by the Ant build system edit
7+
# "ant.properties", and override values to adapt the script to your
8+
# project structure.
9+
#
10+
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11+
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12+
13+
# Project target.
14+
target=Google Inc.:Google APIs:15
9.18 KB
Loading

0 commit comments

Comments
 (0)