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
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.
Previously, I used ImageButtons to navigate through Activities. Now I am going to make a standard Left Navigation Drawer. But the Application need to Extend Activity where as the Default Navigation includes Extend NavigationDrawerActivity. How to Handle this?
I need something like:
public class Main extends Activity {
//Bla Bla Bla
}
And the Drawer Sample App already has this piece of cake:
public class Main extends ActionBarActivity implements
NavigationDrawerFragment.NavigationDrawerCallbacks {
private NavigationDrawerFragment mNavigationDrawerFragment;
//This and that
}
The ActionBarActivity already extends the Activity class so if your activity extends ActionBarActivity nothing you have will break.
(You will need to have support library v7 in order for you to be able to extend ActionBarActivity)
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 have MyActivity extends MyBaseActivity which in tern extends Activity. If my BaseActivity extends FragmentActivity is that all that is needed for MyActivity to use Fragements or is more refactoring needed?
If you have this:
public class MyBaseActivity extends FragmentActivity{}
public class MyActivity extends MyBaseActivity{}
Yes, MyActivity can use fragments.
FragmentActivity If MyBaseActivity extends FragmentActivity, then MyActivity can use fragments.
You use FragmentActivity when using Android Compatibility Package on a pre-API11 device, so you should also include android.support.v4 in libs directory.
I'm new in Android.
How am I be able to extend an Activity with both MapActivity and ActivityGroup??
Because I need to display both a Map and a customized Tab on an Activty.
public class MainActivity extends ActivityGroup implements MapActivity
Somehow I'm not allowed to do that.
To display a tab use Fragment, coz ActivityGroup is Depreciated.