design - Responsibility of an android fragment with buttons -


suppose have activity , fragment provides controls, buttons might trigger action. how think should design ? 1. can put code take relevant actions in fragment itself. 2. can define callback , make parent activity implement it, , whenever button pressed let parent activity know through callback.

the trouble 2 parent activity might grow out large one. trouble 1 not feel right taking actions form within fragments.

any regarding these 2 methods or other way in can go tacking invited.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -