Should adapters in Android be static inner classes or non-static inner classes
问题 I have a ListView in an Activity and I am setting a custom adapter to the ListView. Should my adapter class be: private static class MyAdapter extends ArrayAdapter or private class MyAdapter extends ArrayAdapter I guess it should make no difference as long as the adapter is enclosed within the activity reference but wanted to confirm that. 回答1: Holding onto the context is fine from within an adapter if you are careful about how you use the adapter. Adapters are usually tied to the lifecycle