Where is the service leak in this following code?
<pre><code>  public void AddCustomEvent() {
        ListView lv = (ListView) findViewById(R.id.listView1);


        final Set&lt;String&gt; tasks = sp.getStringSet("tasks", new HashSet&lt;String&gt;());

        ArrayList&lt;String&gt; taskarr = new ArrayList&lt;String&gt;();

        lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {

            @Override
            public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                                    int position, long id) {

                Log.i("Hello!", String.valueOf(position) + " " + String.valueOf(id));

                final int pos = position;
                AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
                        getApplicationContext());

                // set title
                alertDialogBuilder.setTitle("Do you want to delete this task");

                // set dialog message
                alertDialogBuilder
                        .setMessage("Click yes to delete !")
                        .setCancelable(false)
                        .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog, int id) {
                                // if this button is clicked, close
                                // current activity


                                Set&lt;String&gt; tasks = sp.getStringSet("tasks", new HashSet&lt;String&gt;());

                                final ListView listview = (ListView) findViewById(R.id.listView1);

                                final ArrayList&lt;String&gt; list = new ArrayList&lt;String&gt;();
                                for (String str : tasks) {
                                    list.add(str);
                                }
                                list.remove(pos);

                                Set&lt;String&gt; newTasks = new HashSet&lt;String&gt;();

                                for (String str : list) {
                                    newTasks.add(str);
                                }

                                Editor edit = sp.edit();

                                edit.putStringSet("tasks", newTasks);

                                edit.commit();

                                final StableArrayAdapter adapter = new StableArrayAdapter(getApplicationContext(),
                                        android.R.layout.simple_list_item_1, list);

                                listview.setAdapter(adapter);

                            }
                        })
                        .setNegativeButton("No", new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog, int id) {
                                // if this button is clicked, just close
                                // the dialog box and do nothing
                                dialog.cancel();
                            }
                        });

                // create alert dialog
                AlertDialog alertDialog = alertDialogBuilder.create();

                // show it
                alertDialog.show();


            }

        });
    }
</code></pre>

<p>I make a task app. it's show the alertdialog before the remove of task.Nothing special. My code is broken because of its' crash (where I want to show the alertdialog).</p>

<p>Do someone check the code and let me know how and where I leak the service.</p>

<p><a href="http://pastebin.com/edsS9CQh" rel="nofollow">http://pastebin.com/edsS9CQh</a></p>
