José Antonio Pérez Sánchez avatar José Antonio Pérez Sánchez committed ba753cb

sort descending by _id

Comments (0)

Files changed (2)


+  <Button
+      android:id="@+id/create_event"
+      android:text="Create Event"
+      android:layout_height="wrap_content"
+      android:layout_width="wrap_content"
+      android:layout_weight="0" />


 import android.widget.TextView;
 import android.widget.Toast;
+import java.util.TimeZone;
 public class MainActivity extends Activity implements OnClickListener {
 	private static final String[] DEFAULT_PROVIDERS = { "sms", "sms/inbox", "sms/sent", "call_log",
-		AutoCompleteTextView uri = (AutoCompleteTextView) findViewById(;
+		final AutoCompleteTextView uri = (AutoCompleteTextView) findViewById(;
 		uri.setAdapter(new ArrayAdapter<String>(this,
 				android.R.layout.simple_dropdown_item_1line, DEFAULT_PROVIDERS));
-		Button submit = (Button) findViewById(;
+		final Button submit = (Button) findViewById(;
+        final Button createEvent = (Button) findViewById(;
+        createEvent.setOnClickListener(new OnClickListener() {
+            public void onClick(View v) {
+                Toast.makeText(getApplicationContext(), TimeZone.getDefault().getID(), Toast.LENGTH_LONG).show();
+            }
+        });
 	public void onClick(View v) {
 		// create cursor
 		try {
-			Cursor cur = managedQuery(uri, null, null, null, null);
+			Cursor cur = managedQuery(uri, null, null, null, "_id desc");
 			GridView grid = (GridView) findViewById(;
 			grid.setAdapter(new DynamicCursorAdapter(this, cur, R.layout.entry));
 		} catch (Exception e) {
 			// fixme: never shown!
-			Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG);
+			Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.