This repository has been archived by the owner on Nov 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
WebDucer
committed
Apr 7, 2014
1 parent
bb5b99f
commit a7ebcec
Showing
7 changed files
with
233 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ListView xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:id="@android:id/list" > | ||
|
||
|
||
</ListView> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<menu xmlns:android="http://schemas.android.com/apk/res/android" > | ||
<item android:id="@+id/mnu_list" android:title="@string/mnu_list" android:showAsAction="ifRoom"></item> | ||
|
||
|
||
</menu> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
Zeiterfassung/src/de/mvhs/android/zeiterfassung/AuflistungActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package de.mvhs.android.zeiterfassung; | ||
|
||
import android.app.ListActivity; | ||
import android.database.Cursor; | ||
import android.os.Bundle; | ||
import android.view.MenuItem; | ||
import android.widget.SimpleCursorAdapter; | ||
import de.mvhs.android.zeiterfassung.db.ZeitContracts; | ||
|
||
public class AuflistungActivity extends ListActivity { | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
|
||
setContentView(R.layout.activity_list); | ||
|
||
getActionBar().setDisplayHomeAsUpEnabled(true); | ||
getActionBar().setDisplayShowHomeEnabled(true); | ||
} | ||
|
||
@Override | ||
protected void onStart() { | ||
super.onStart(); | ||
|
||
// Laden der Daten | ||
// -- Einen Adapter initialisieren | ||
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, // Context | ||
android.R.layout.simple_list_item_2, // Layout für die Zeile | ||
null, // Cursor Daten | ||
new String[] { ZeitContracts.Zeit.Columns.START, | ||
ZeitContracts.Zeit.Columns.END }, new int[] { | ||
android.R.id.text1, android.R.id.text2 }, // UI-Elemente | ||
// in denen | ||
// diese | ||
// Werte | ||
// dargestellt | ||
// werden | ||
// sollen | ||
0); | ||
|
||
// Laden der Daten | ||
Cursor data = getContentResolver().query( | ||
ZeitContracts.Zeit.CONTENT_URI, null, null, null, null); | ||
|
||
// Zuordnung des Adapters zur Liste | ||
getListView().setAdapter(adapter); | ||
|
||
// Daten an Adapter übergeben | ||
adapter.swapCursor(data); | ||
} | ||
|
||
@Override | ||
public boolean onOptionsItemSelected(MenuItem item) { | ||
switch (item.getItemId()) { | ||
case android.R.id.home: | ||
this.finish(); | ||
|
||
break; | ||
|
||
default: | ||
break; | ||
} | ||
return super.onOptionsItemSelected(item); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters