How can I pass the getSupportFragmentManager() to external library in AccountAuthenticatorActivity?.
I need to put a custom dialog with android-styled-dialogs: https://github.com/inmite/android-styled-dialogs
Take AccountAuthenticatorActivity and put it in your project.
Instead of
AccountAuthenticatorActivity extends Activity put AccountAuthenticatorActivity extends FragmentActivity.
Extend your class with your new AccountAuthenticatorActivity and use getSupportFragmentManager().
Related
My main activity extends AppCompatActivity where I create and inflate my menu. I also want my main activity to contain a map fragment. This requires that my main activity extends FragmentActivity, but I cannot extend from two super classes. How am I supposed to add a map fragment to my main activity?
AppCompatActivity extends FragmentActivity, so you get all of the functionality in FragmentActivity by extending AppCompatActivity.
Well, AppCompatActivity already extends FragmentActivity, so there should be no problem.
I'm using AppCompatPreferenceActivity, that is an Activity which extends PreferenceActivity and has an AppCompatDelegate. I want to add a headless fragment to this Activity, but I can't call to getSupportFragmentManager...
Is there a way to add fragments to a PreferenceActivity using AppCompatDelegate?
The only way to call getSupportFragmentManager is from a FragmentActivity or something which derives from it. PreferenceActivity derives from Activity which cannot use Fragments.
You should look into using a PreferenceFragment instead.
Since the new Android SDK Update I have a ActionBarActivity for my MainActivity.
Before that is was a normal activity and I just replaced it with the: ListActivity
How can I add use the ListActivity in my new MainActivity which is a ActionBarActivity?
You can get rid of extends ActionbarActivity and extends ListActivity. You could also use ListFragment.
You can extend ActionBarActivtiy and use ListFragment from the support library
http://developer.android.com/reference/android/support/v4/app/ListFragment.html
I'm using CalendarDatePickerDialog from BetterPickers in my project,
if i use a FragmentActivity, then i can use the getSupportFragmentManager().
The problem is that i'm trying to add CWAC-Camera as well,
but for that i need to use
getFragmentManager() in a regular Activity which breaks the BettePickers.
any ideas?
Try to extends FragmentActivity and implements CalendarDatePickerDialog.OnDateSetListener
Change your Activity to FragmentActivity.
Use the newInstance(YouActivity.this)
Enjoy!
In the documentar from SlidingMenu is written down:
Go into the SlidingActivities that you plan on using make them extend Sherlock__Activity instead of __Activity.
The setup should be ok, I followed the guide, but if I try to extend my Activity with for example: SlidingSherlockFragmentActivity or SherlockSlidingFragmentActivity doesn't work.
If I extend my Activity with SherlockFragmentActivity I can't get the SlidingMenu with getSlidingMenu() or call setBehindContentView.
Nevermind, go into the SlidingMenu library and extend the Activity by SherlockFragmentActivity instead of FragmentActivity
Go to activities of library SlidingMenu and extends all activities to SherlockActivities corresponding, after go to your app and extends all activities to SlidingActivity corresponding.
Example: SlidingMenu:
SlidingActivity extends SherlockActivity
SlidingMapActivity extends SherlockMapActivity
Example: MyClass
MyClass extends SlidingActivity
MyClass extends SlidingMapActivity