Browse Source

Readme fix.

Aidan Follestad 10 years ago
parent
commit
130d83c72e
1 changed files with 8 additions and 6 deletions
  1. 8 6
      README.md

+ 8 - 6
README.md

@@ -280,12 +280,14 @@ exactly how you want your list to work.
 ```java
 new MaterialDialog.Builder(this)
         .title(R.string.socialNetworks)
-        .adapter(new ButtonItemAdapter(this, R.array.socialNetworks))
-        .itemsCallback(new MaterialDialog.ListCallback() {
-            @Override
-            public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) {
-            }
-        }).show();
+        .adapter(new ButtonItemAdapter(this, R.array.socialNetworks),
+                new MaterialDialog.ListCallback() {
+                    @Override
+                    public void onSelection(MaterialDialog dialog, View itemView, int which, CharSequence text) {
+                        Toast.makeText(MainActivity.this, "Clicked item " + which, Toast.LENGTH_SHORT).show();
+                    }
+                })
+        .show();
 ```
 
 If you need access to the `ListView`, you can use the `MaterialDialog` instance.