24

Is there are way to use fragments with the AccountAuthenticatorActivity when I'm using the Support Package? AccountAuthenitactorActivity does not subclass the FragmentActivity class and therefore I'm not sure how to use fragments with it when I'm using the Support package.

Kurtis Nusbaum
  • 30,445
  • 13
  • 78
  • 102

1 Answers1

30

No, but the AccountAuthenticatorActivity is just a helper class that does some basic plumbing on the AccountAuthenticatorResponse - you're not required to subclass it.

Just borrow (from here, for instance - the code hasn't changed any between this snapshot and ICS) the relevant functionality and extend whatever base class you want and you're good to go.

Jens
  • 16,853
  • 4
  • 55
  • 52
  • So you don't have to subclass AccountAuthenticatorActivity in order to get things to work? Could you cite something that definitively says that. I couldn't find anything that explicitly says you don't have to subclass it. Maybe I'm just being overzelous. – Kurtis Nusbaum Jan 31 '12 at 18:34
  • Well, for instance the documentation states that it's there to help you, etc. The wording is very conditional. I've also done it (but I subclassed a ListActivity, but it's basically the same thing). – Jens Jan 31 '12 at 20:10
  • 5
    The source code is also available here: https://github.com/android/platform_frameworks_base/blob/master/core/java/android/accounts/AccountAuthenticatorActivity.java – Christian Strempfer Dec 27 '13 at 12:43
  • Do you have an example of this implementation? – Bootstrapper Nov 23 '15 at 08:12