Skip to content

Commit f5d6966

Browse files
committed
Fixed error in Android service example
1 parent a60f61f commit f5d6966

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

de.vogella.android.ownservice.local/res/layout/main.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
android:id="@+id/button1"
1414
android:layout_width="wrap_content"
1515
android:layout_height="wrap_content"
16-
android:onClick="showServiceData"
17-
android:text="Button" >
16+
android:onClick="onClick"
17+
android:text="Update" >
1818
</Button>
1919

2020
<ListView

de.vogella.android.ownservice.local/src/de/vogella/android/ownservice/local/MainActivity.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
public class MainActivity extends ListActivity {
1818
private LocalWordService s;
1919

20-
/** Called when the activity is first created. */
2120
@Override
2221
public void onCreate(Bundle savedInstanceState) {
2322
super.onCreate(savedInstanceState);
@@ -61,9 +60,8 @@ public void onServiceDisconnected(ComponentName className) {
6160
private ArrayAdapter<String> adapter;
6261
private List<String> wordList;
6362

64-
public void showServiceData(View view) {
63+
public void onClick(View view) {
6564
if (s != null) {
66-
6765
Toast.makeText(this, "Number of elements" + s.getWordList().size(),
6866
Toast.LENGTH_SHORT).show();
6967
wordList.clear();

0 commit comments

Comments
 (0)