0

I am in a bit of trouble, I have an already made app which uses a traditional menu (more like a social networking app), Now, I have decided to replace that menu with a swipe style menu based on the jfeinstein10/SlidingMenu library.

AS far as I know and have read, the way to integrate that library is to extend the main activity with the sliding menu class, However, The problem I face is that since my app uses the google maps api, It already extends the Map Activity,

    public class MainActivity extends MapActivity implements View.OnClickListener

Hence, I am not sure how to further include the sliding activity since java doesn't support multiple inheritance. Further, I can't use an instance of the other classes. I know that there is some other way for example directly through a constructor of integrating the library as well. Any help, Thanks !!

Mikelbstek
  • 61
  • 2
  • 10
  • SlidingActivty extends MapActivity and used SlideingActivity to MainActivity. Plz try this, might be worked for u. – Hiren Dabhi Mar 25 '13 at 09:31

2 Answers2

0

There is method to include the Library Projects in your project.

  1. Import the library project in your workspace.

    File > Import > Android > Existing code in workspace > Browse to the library project > Ok

  2. Add a reference of the library project in your project.

    Right click on your project > Properties > Android > Add > Choose your library project > Ok

Another method is by adding the jar file.

Right click on your project > Properties > Java Build Path > Libraries > Add External jar > Browse to the jar file > Ok

OR

Create a folder named libs in your project (if not already present). Then copy the jar file into this folder.

After you do this you can use the library project as per your needs.

No need to extend it to your class name. It just needs to be imported.

import library_package_name.classname;

Hope this helps !!

Laksh
  • 6,717
  • 6
  • 33
  • 34
0

You should use MapFragment API v2, so your activity could extend SlidingFragmentActivity, and you could put the mapfragment as a separate unit into it.

I know, this can be a big work, but it's recommended to use this solution, as its performance is much better, and MapActivity is not suported since march 1, for example you can't request an API key to it anymore.

Analizer
  • 1,594
  • 16
  • 30