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
Post a Comment