Hi Nadeem,
The reason why I chose fragment over widget is that fragment has callback 
methods such as
onCreate(), onResume, onPause, onDestroy that I need in order for my UI 
component to work properly.
This implies that clients can just declare my fragment in their layout and 
it'll all work.

If I write a widget, then I'd need to write apis for client's to call, and 
require everyone who uses my widget
to call these apis in their activity's callback method in order to have 
correct behavior from my UI component.
I just found this troublesome, and I believe fragment is here to solve this 
problem (Separate controller logic to fragment
and view code to widget).

On Tuesday, May 15, 2012 1:42:40 AM UTC+8, Nadeem Hasan wrote:
>
> Why don't you factor out the functionality into a custom widget and use it 
> in both the listview and fragment?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to