Skip to content

Commit 3f8275d

Browse files
committed
updates
1 parent bd3ddd6 commit 3f8275d

7 files changed

Lines changed: 26 additions & 65 deletions

File tree

‎de.vogella.android.socialapp/AndroidManifest.xml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<application
1010
android:icon="@drawable/ic_launcher"
1111
android:label="@string/app_name"
12-
android:uiOptions="splitActionBarWhenNarrow"
1312
>
1413
<activity
1514
android:label="@string/app_name"

‎de.vogella.android.socialapp/res/layout/main.xml‎

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,29 @@
22
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
android:layout_width="fill_parent"
44
android:layout_height="fill_parent"
5-
android:background="@drawable/fire"
65
android:orientation="vertical" >
76

87
<LinearLayout
9-
android:id="@+id/layout"
10-
android:layout_width="wrap_content"
11-
android:layout_height="wrap_content" >
8+
style="?android:attr/buttonBarStyle"
9+
android:layout_width="match_parent"
10+
android:layout_height="wrap_content"
11+
android:orientation="horizontal" >
1212

1313
<Button
1414
android:id="@+id/Button01"
15-
android:layout_width="wrap_content"
15+
style="?android:attr/buttonBarButtonStyle"
16+
android:layout_width="0dp"
1617
android:layout_height="wrap_content"
17-
android:text="Show" >
18-
</Button>
18+
android:layout_weight="1"
19+
android:text="Show" />
1920

2021
<Button
2122
android:id="@+id/Button02"
22-
android:layout_width="wrap_content"
23+
style="?android:attr/buttonBarButtonStyle"
24+
android:layout_width="0dp"
2325
android:layout_height="wrap_content"
26+
android:layout_weight="1"
2427
android:text="Change" />
25-
2628
</LinearLayout>
2729

28-
<CalendarView
29-
android:id="@+id/calendarView1"
30-
android:layout_width="match_parent"
31-
android:layout_height="match_parent" />
32-
3330
</LinearLayout>
Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
33

4-
<item
5-
android:id="@+id/menu_share"
6-
android:actionProviderClass="android.widget.ShareActionProvider"
7-
android:showAsAction="ifRoom"
8-
android:title="Share"/>
9-
104
<item
115
android:id="@+id/preferences"
126
android:showAsAction="ifRoom"
137
android:title="Prefs">
148
</item>
15-
<item
16-
android:id="@+id/preferences2"
17-
android:showAsAction="ifRoom"
18-
android:title="More">
19-
</item>
20-
<item
21-
android:id="@+id/preferences3"
22-
android:title="Internet">
23-
</item>
24-
<item
25-
android:id="@+id/preferences4"
26-
android:title="Take Picture">
27-
</item>
28-
<item
29-
android:id="@+id/preferences5"
30-
android:title="Share with others">
31-
</item>
32-
<item
33-
android:id="@+id/preferences6"
34-
android:title="Time">
35-
</item>
369

3710
</menu>

‎de.vogella.android.socialapp/src/de/vogella/android/socialapp/OverviewActivity.java‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import android.view.View;
1414
import android.view.View.OnClickListener;
1515
import android.widget.Button;
16-
import android.widget.ShareActionProvider;
1716
import android.widget.Toast;
1817

1918
public class OverviewActivity extends Activity {
@@ -74,13 +73,13 @@ private void updatePreferenceValue() {
7473
public boolean onCreateOptionsMenu(Menu menu) {
7574
MenuInflater inflater = getMenuInflater();
7675
inflater.inflate(R.menu.mainmenu, menu);
77-
MenuItem item = menu.findItem(R.id.menu_share);
78-
ShareActionProvider provider = (ShareActionProvider) item
79-
.getActionProvider();
80-
Intent intent = new Intent(Intent.ACTION_SEND);
81-
intent.setType("plain/text");
82-
intent.putExtra(Intent.EXTRA_TEXT, "Hello");
83-
provider.setShareIntent(intent);
76+
// MenuItem item = menu.findItem(R.id.menu_share);
77+
// ShareActionProvider provider = (ShareActionProvider) item
78+
// .getActionProvider();
79+
// Intent intent = new Intent(Intent.ACTION_SEND);
80+
// intent.setType("plain/text");
81+
// intent.putExtra(Intent.EXTRA_TEXT, "Hello");
82+
// provider.setShareIntent(intent);
8483
return true;
8584
}
8685

‎de.vogella.xml.jaxb/bookstore-jaxb.xml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
<bookList>
44
<book>
55
<author>Neil Strauss</author>
6-
<bookName>The Game</bookName>
6+
<title>The Game</title>
77
<publisher>Harpercollins</publisher>
88
<isbn>978-0060554736</isbn>
99
</book>
1010
<book>
1111
<author>Charlotte Roche</author>
12-
<bookName>Feuchtgebiete</bookName>
12+
<title>Feuchtgebiete</title>
1313
<publisher>Dumont Buchverlag</publisher>
1414
<isbn>978-3832180577</isbn>
1515
</book>

‎de.vogella.xml.jaxb/src/de/vogella/xml/jaxb/model/Book.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class Book {
1717

1818
// If you like the variable name, e.g. "name", you can easily change this
1919
// name for your XML-Output:
20-
@XmlElement(name = "bookName")
20+
@XmlElement(name = "title")
2121
public String getName() {
2222
return name;
2323
}

‎de.vogella.xml.jaxb/src/test/BookMain.java‎

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package test;
22

3+
import java.io.File;
34
import java.io.FileReader;
4-
import java.io.FileWriter;
55
import java.io.IOException;
6-
import java.io.Writer;
76
import java.util.ArrayList;
87

98
import javax.xml.bind.JAXBContext;
@@ -47,18 +46,12 @@ public static void main(String[] args) throws JAXBException, IOException {
4746
JAXBContext context = JAXBContext.newInstance(Bookstore.class);
4847
Marshaller m = context.createMarshaller();
4948
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
49+
50+
// Write to System.out
5051
m.marshal(bookstore, System.out);
5152

52-
Writer w = null;
53-
try {
54-
w = new FileWriter(BOOKSTORE_XML);
55-
m.marshal(bookstore, w);
56-
} finally {
57-
try {
58-
w.close();
59-
} catch (Exception e) {
60-
}
61-
}
53+
// Write to File
54+
m.marshal(bookstore, new File(BOOKSTORE_XML));
6255

6356
// get variables from our xml file, created before
6457
System.out.println();

0 commit comments

Comments
 (0)