I want to check the better and faster way for program of using adapter for a ListView. Is it out or in activity class?
This is more of a Java question than Android.
Inner classes are more for making your code readable and do not affect performance as long as you use static inner classes. Static inner classes are pulled out by the compiler and compiled as separate classes (Class$InnerClass).
So if using inner classes are helpful to you in terms of code organization, you can safely go ahead and use them. Though I'd strongly recommend using static inner classes.
Edit
Static inner classes suffice in this context, which is of an adapter which wouldn't need access to any of the variables of the Activity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With