Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to extend Fragment and Activity

Is there a way to extend Fragment and Activity together?

class MyEditorFragment extends Fragment implements TextStuff,
    Stuff2Listener, OnClickListener<Cursor>
like image 505
saltais Avatar asked Nov 24 '25 01:11

saltais


1 Answers

Take note of this: There is no way to subclass more than one superclass at a time.

Besides, Fragment is actually a mini activity itself, which can be associated with a parent activity. You might want to refer to the official documentation as it provides clear explanation.

Additionally:

Take note that Fragment article is sub-listed under Activity in the documentation

like image 89
Arif Samin Avatar answered Nov 26 '25 15:11

Arif Samin