导入android SlidingMenu 应用
SlidingMenu is a helpful Android library for developers. It creates a side navigation like the Facebook app but it is not easy to setup the library nor the example. Here you will find the steps to make the library and example free of errors and ready to use.
Step 1: Import the library and example
Download the library as well as the app on GitHub (https://github.com/jfeinstein10/slidingmenu).
Then, unzip the file and create a new project in Eclipse. Select Android Project from Existing Code and click Next. Click Browse and choose the folder where you unzip the SlidingMenu library. Check Copy projects into workspace and click Finish. You have imported
the library and example but you have an X icon next to the SlidingMenu library project and an exclamation mark icon next to the example project.
Step 2: Fix errors in SlidingMenu library project
The following list describes the possible errors that you might have after importing the library:
Console error: Unable to resolve target ‘Google Inc.:Google APIs:16.
Fix: Go to Properties for library and check Google APIs for the desired platform.
List of errors: ACTION_POINTER_INDEX_MASK cannot be resolved android.
HONEYCOMB cannot be resolved or is not a field
LAYER_TYPE_HARDWARE cannot be resolved or is not a field
LAYER_TYPE_NONE cannot be resolved or is not a field
MATCH_PARENT cannot be resolved or is not a field
The method getLayerType() is undefined for the type View
The method setLayerType(int, null) is undefined for the type ViewFix: Change the min sdk version of the library manifest with a recent one.
Step 3: Fix errors in SlidingMenu example project
After importing the example, these are the possible errors:
Console error: Found 2 versions of android-support-v4.jar in the dependency list,but not all the versions are identical (check is based
on SHA-1 only at this time). Jar mismatch! Fix your dependenciesFix: Identify which project has the latest version and copy it on the old version. Clean the projects and restart eclipse if the error
messages still appear in the console tab.List of errors: The method getSupportActionBar() is undefined for the type BaseActivity
The method getSupportMenuInflater() is undefined for the type BaseActivity
The method onCreateOptionsMenu(Menu) of type BaseActivity must override or implement a supertype method
The method onOptionsItemSelected(MenuItem) in the type Activity is not applicable for the arguments
The method onOptionsItemSelected(MenuItem) of type BaseActivity must override or implement a supertype method
The method onOptionsItemSelected(MenuItem) of type ResponsiveUIActivity must override or implement a supertype methodFix: Open SlidingFragmentActivity class of the SlidingMenu library project and add the following code before declaring the class:
import com.actionbarsherlock.app.SherlockFragmentActivity;Then, replace the class declaration:
public class SlidingFragmentActivity extends FragmentActivity implements SlidingActivityBase {with:
public class SlidingFragmentActivity extends SherlockFragmentActivity implements SlidingActivityBase {Clean and build the project if the error messages still appear.
Tip:Make sure that your example project is referencing the ActionBarSherlock and SlidingMenu library contained in your workspace.
Summary: Although SlidingMenu is a helpful Open Source library for Android developers, setting up the library and the example are not
easy to do. So, this article intends to save you time on researching each error that you get after importing the library and example files.
导入android SlidingMenu 应用的更多相关文章
- Android SlidingMenu侧滑菜单使用
把下载的侧滑菜单压缩包打开,会有一个library文件夹,在eclipse中import existing android code into workspace,导入library文件夹,并且选择作 ...
- Android slidingmenu详细解释 滑动的优化
Android slidingmenu 详细解释 性能优化 转载请注明: http://blog.csdn.net/aaawqqq 简单介绍 SlidingMenu 是github 上Androi ...
- eclipse — 导入android项目后识别成java项目的问题及解决
最近在eclipse导入android项目的时候遇到了奇葩问题,再此记录 遇到的问题就是:将完好的android项目导入到eclipse的时候,原本这是一个很容易的事情,但是导入成功后发现,,,靠ec ...
- GJM :Unity3d导出eclipse工程,导入Android Studio
unity3d导出eclipse工程,导入Android Studio 标签: unity3Dandroid studio 2016-08-11 10:42 398人阅读 评论(1) 收藏 举报 分类 ...
- Eclipse导入Android项目的正确方法
转自Eclipse导入Android项目的正确方法 看网上流传的Eclipse导入项目的方法都是在新建Android程序时使用"Create project form existing so ...
- eclipse 导入Android项目时报告 Invalid Project Description
现象描述: 1.新建Android项目XX2.删除Android项目XX3.使用Existing Android Code Into Workspace(EACIW)导入Android项目XX,报错: ...
- Eclipse项目导入Android Stuio 配置出现 Timeout waiting to lock buildscript class cache for build file 'H:\studioproject\Generic_SN\build.gradle'
Eclipse项目导入Android Stuio 配置出现 Error:Timeout waiting to lock buildscript class cache for build file ...
- 导入android项目在eclipse中会报@Override错误
很多时候导入android项目在eclipse中会报@Override错误,这是由于java编译器的版本不正确,Java 1.5的编译器默认对父类的方法进行覆盖,采用@Override进行说明:但1. ...
- 解决:eclipse导入android时工程下没有R文件的问题,以及style.xml文件报错
解决:eclipse导入android时工程下没有R文件的问题,以及style.xml文件报错
随机推荐
- T-SQL动态查询(2)——关键字查询
接上文:T-SQL动态查询(1)--简介 前言: 在开发功能的过程中,我们常常会遇到类似以下情景:应用程序有一个查询功能,允许用户在很多查询条件中选择所需条件.这个也是本系列的关注点. 但是有时候你也 ...
- Eclipse开发C/C++ 安装配置
1. jdk环境配置 2. eclipse 下载 3. MinGW 下载安装 4. 编写Hello Word jdk环境配置 环境配置我就不多说了,网上 ...
- 【Unity Shaders】ShadowGun系列之一——飞机坠毁的浓烟效果
写在前面 最近一直在思考下面的学习该怎么进行,当然自己有在一边做项目一边学OpenGL,偶尔翻翻论文之类的.但是,写shader是一个需要实战和动手经验的过程,而模仿是前期学习的必经之路.很多人都会问 ...
- ubuntu opengl 开发
开发环境: eclipse,需要安装C++开发插件,在自带的源中查找安装C++开发工具包即可 下载安装gl库: sudo apt-get install libgl1-mesa-dev 下载安装glu ...
- ios7内购、Game Center 实现 in-App Purchases & Game Center
猴子原创,欢迎转载.转载请注明: 转载自Cocos2D开发网–Cocos2Dev.com,谢谢! 原文地址: http://www.cocos2dev.com/?p=514 昨天使用ios7SDK b ...
- cocos2dx 3.3 C++工程添加lua支持
准备工作: 1. 拷贝cocos2d-x-3.3rc0\external\lua整个文件夹到项目中(如myProject\cocos2d\external\lua) 2. 拷贝cocos2d-x-3. ...
- 最简单的基于librtmp的示例:接收(RTMP保存为FLV)
===================================================== 最简单的基于libRTMP的示例系列文章列表: 最简单的基于librtmp的示例:接收(RT ...
- Redefine:Change in the Changing World
EMC World 2014的主题就是REDEFINE.的确,现在科技的发展在重新定义了技术,影响了生活,改变了你我. 对于一个有数万员工,甚至数十万员工的企业来说,Redefine无疑更加具有挑战, ...
- cocos2dx深度检测与Zorder
cocos2dx里面有两个渲染队列,RenderQueue和TransparentRenderQueue.我们可以从Renderer::render()的代码看到: void Renderer::re ...
- 【Unity Shaders】Reflecting Your World —— 在Unity3D中创建Cubemaps
本系列主要参考<Unity Shaders and Effects Cookbook>一书(感谢原书作者),同时会加上一点个人理解或拓展. 这里是本书所有的插图.这里是本书所需的代码和资源 ...