Question: How can I reload a ListView from inside an AlertDialog? This AlertDialog is spawned by a ContectMenu.

```
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    registerForContextMenu(getListView());
    ......
    MatrixCursor cursor;
    cursor = NameManager.getnameList();
    ........
    final SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
            R.layout.row, cursor, from, to);
    setListAdapter(adapter);
}
.......
.......
case R.id.delete:
            new AlertDialog.Builder(this)
            .setTitle("Delete " + cursor.getString(1))
            .setMessage("Are you sure?")
            .setPositiveButton("Ok",
                    new DialogInterface.OnClickListener() {
                @Override
                public void onClick(
                        DialogInterface dialogInterface, int i) {
                    try {
                        .......
                        // TODO reload listview

                    } catch (IOException e) {
                        e.printStackTrace();
                        return;
                    }
                }
            }).setNeutralButton("Cancel", null)
            .create().show();
            return true;

```

Answer: 
> 
> However, my problem is a bit more complicated in that the abstract
>  class has multiple final fields of varying types.
> 
> 
> 

I'm not sure I understand the added complexity in your scenario, but I'm interpreting your issue as : I don't want to have a ton of arguments on my abstract constructor. One possible approach is to have a [Builder](http://en.wikipedia.org/wiki/Builder_pattern) for the abstract class that is used by the concrete sub classes. The builder is then 'passed up' to the abstract constructor for setting the final fields.
When I have a need for an immutable object (all members are final) that takes many different parameters in the constructor I usually use a Builder pattern.

In this case you can make the builders subclass each other and in this way you will still maintain the ability to extend.

For an example you can see the Guava API for ImmutableCollection [Builder](http://guava-libraries.googlecode.com/svn/trunk/javadoc/com/google/common/collect/ImmutableCollection.Builder.html).
Or if you don't require immutability, here is an example of [CacheBuilder](http://guava-libraries.googlecode.com/svn/trunk/javadoc/com/google/common/cache/CacheBuilder.html) also taken from the same library:

```
Cache<Key, Graph> graphs = CacheBuilder.newBuilder()
   .concurrencyLevel(4)
   .weakKeys()
   .maximumSize(10000)
   .expireAfterWrite(10, TimeUnit.MINUTES)
   .build(
       new CacheLoader<Key, Graph>() {
         public Graph load(Key key) throws AnyException {
           return createExpensiveGraph(key);
         }
       });

```

As you can see the use of a builder replaces the need to pass in 6 parameters in the constructor and makes for more readable/usable code.

If you still don't want to use builders I would go with option (3) as that will prevent some of the hassle of maintaining a very long constructor