How to set up Jfeinstein10 sliding menu on android / eclipse

I am trying to set the JFeinstein10 sliding menu to eclipse.

What I tried:

  • file > import > from existing android.. > select the library of sliding menu
  • file > import > from ex.. > select the example of sliding me
  • file > import > from ex.. > select actionbarsherlock library
  • mark slidingmenu lib and actionbarlib as library
  • add the library to example of sldingmenu
  • cleanup all

and then I get various errors (for example: jar mismatch, .. cannot be resolved to type, method .. type .. must redefine the superclass method), I parse them and use the cleanup and quick fix options. but i don't work.

I hope one of you knows a good textbook, or maybe you can write or know what to do.

I am new to Android development, all my previous applications are made in webview .

I also tried https://github.com/johnkil/SideNavigation (also didnโ€™t work if someone knows how to configure this, great!) And grimbo a sliding menu (it worked, but thatโ€™s not what I am looking for)

errors are in the library only in slidingmapactivity (shown below), and in the actibarsherlock library there are many files with errors (in almost any file in the src folder)

 code in lib: slidingmapactivity: package com.slidingmenu.lib.app; import android.os.Bundle; import android.view.KeyEvent; import android.view.View; import android.view.ViewGroup.LayoutParams; import com.slidingmenu.lib.SlidingMenu; public abstract class SlidingMapActivity extends MapActivity implements SlidingActivityBase { private SlidingActivityHelper mHelper; /* (non-Javadoc) * @see com.google.android.maps.MapActivity#onCreate(android.os.Bundle) */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mHelper = new SlidingActivityHelper(this); mHelper.onCreate(savedInstanceState); } /* (non-Javadoc) * @see android.app.Activity#onPostCreate(android.os.Bundle) */ @Override public void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); mHelper.onPostCreate(savedInstanceState); } /* (non-Javadoc) * @see android.app.Activity#findViewById(int) */ @Override public View findViewById(int id) { View v = super.findViewById(id); if (v != null) return v; return mHelper.findViewById(id); } /* (non-Javadoc) * @see android.app.Activity#onSaveInstanceState(android.os.Bundle) */ @Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); mHelper.onSaveInstanceState(outState); } /* (non-Javadoc) * @see android.app.Activity#setContentView(int) */ @Override public void setContentView(int id) { setContentView(getLayoutInflater().inflate(id, null)); } /* (non-Javadoc) * @see android.app.Activity#setContentView(android.view.View) */ @Override public void setContentView(View v) { setContentView(v, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); } /* (non-Javadoc) * @see android.app.Activity#setContentView(android.view.View, android.view.ViewGroup.LayoutParams) */ @Override public void setContentView(View v, LayoutParams params) { super.setContentView(v, params); mHelper.registerAboveContentView(v, params); } /* (non-Javadoc) * @see com.slidingmenu.lib.app.SlidingActivityBase#setBehindContentView(int) */ @Override public void setBehindContentView(int id) { setBehindContentView(getLayoutInflater().inflate(id, null)); } /* (non-Javadoc) * @see com.slidingmenu.lib.app.SlidingActivityBase#setBehindContentView(android.view.View) */ @Override public void setBehindContentView(View v) { setBehindContentView(v, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); } /* (non-Javadoc) * @see com.slidingmenu.lib.app.SlidingActivityBase#setBehindContentView(android.view.View, android.view.ViewGroup.LayoutParams) */ @Override public void setBehindContentView(View v, LayoutParams params) { mHelper.setBehindContentView(v, params); } /* (non-Javadoc) * @see com.slidingmenu.lib.app.SlidingActivityBase#getSlidingMenu() */ @Override public SlidingMenu getSlidingMenu() { return mHelper.getSlidingMenu(); } /* (non-Javadoc) * @see com.slidingmenu.lib.app.SlidingActivityBase#toggle() */ @Override public void toggle() { mHelper.toggle(); } /* (non-Javadoc) * @see com.slidingmenu.lib.app.SlidingActivityBase#showAbove() */ @Override public void showContent() { mHelper.showContent(); } /* (non-Javadoc) * @see com.slidingmenu.lib.app.SlidingActivityBase#showBehind() */ @Override public void showMenu() { mHelper.showMenu(); } /* (non-Javadoc) * @see com.slidingmenu.lib.app.SlidingActivityBase#showSecondaryMenu() */ @Override public void showSecondaryMenu() { mHelper.showSecondaryMenu(); } /* (non-Javadoc) * @see com.slidingmenu.lib.app.SlidingActivityBase#setSlidingActionBarEnabled(boolean) */ @Override public void setSlidingActionBarEnabled(boolean b) { mHelper.setSlidingActionBarEnabled(b); } /* (non-Javadoc) * @see android.app.Activity#onKeyUp(int, android.view.KeyEvent) */ @Override public boolean onKeyUp(int keyCode, KeyEvent event) { boolean b = mHelper.onKeyUp(keyCode, event); if (b) return b; return super.onKeyUp(keyCode, event); } 

}

+4
source share
2 answers

Ok let's deal with these problems one at a time ...

  • JAR mismatch - I assume this is a support library. Replace the JAR in the SlidingMenu libs folder with a copy from your own libs folder.

  • Cannot be resolved to a type assumes that you did not click on your project properties or add SlidingMenu to the library. Otherwise, click Cmd-Shift-O in the Activity file to fix the import. This will also fix your @Override issues that I consider.

Let me know how you are doing, and I will provide extra help as needed.

+4
source

You should have the same android-support-v4 JOR browser in your SLIDINGMENULIBRARY libs directory, as well as in the PROJECT libs folder.

In fact, go to the SDK folder, go to sdk \ extras \ android \ support \ v4 \ android-support-v4.jar copy this jar and paste it into both directories.

0
source

All Articles