导入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文件报错
随机推荐
- Hadoop与分布式数据处理 Spark VS Hadoop有哪些异同点?
Spark是一个开源的通用并行分布式计算框架,由加州大学伯克利分校的AMP实验室开发,支持内存计算.多迭代批量处理.即席查询.流处理和图计算等多种范式.Spark内存计算框架适合各种迭代算法和交互式数 ...
- python辅助开发模块(非官方)如pil,mysqldb,openpyxl,xlrd,xlwd
官方文档 只是支持win32, 不支持win64 所以很麻烦 民间高人,集中做了一堆辅助库,下载后,用python安装目录下的scripts中,pip和easy_install就可以安装了 pytho ...
- UNIX环境高级编程——标准IO-实现查看所有用户
#include <string.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h&g ...
- Cocos2D v3.4.9粒子效果不能显示的原因分析及解决办法
大熊猫猪·侯佩原创或翻译作品.欢迎转载,转载请注明出处. 如果觉得写的不好请多提意见,如果觉得不错请多多支持点赞.谢谢! hopy ;) 在游戏App中为了衬托气氛我们往往使用一些特殊的图形效果,粒子 ...
- Android的actionBar的菜单使用-android学习之旅(四十三)
ActionBar简介 ActionBar是3.0以后加入的新特性,可用于在顶部显示应用名称和标题.初次之外右边还可以显示活动项. ActionBar应用 ActionBar用法 <?xml v ...
- 【Unity 3D 游戏开发】Unity3D 入门 - 工作区域介绍 与 入门示例
一. 工作区域详解 1. Scence视图 (场景设计面板) scence视图简介 : 展示创建的游戏对象, 可以对所有的游戏对象进行 移动, 操作 和 放置; -- 示例 : 创建一个球体, 控制摄 ...
- Volley请求
1. Volley简介 我们平时在开发Android应用的时候不可避免地都需要用到网络技术,而多数情况下应用程序都会使用HTTP协议来发送和接收网络数据.Android系统中主要提供了两种方式来进行H ...
- MinerConfig.java 爬取配置类
MinerConfig.java 爬取配置类 package com.iteye.injavawetrust.miner; import java.util.List; /** * 爬取配置类 * @ ...
- MySQL学习笔记_6_SQL语言的设计与编写(下)
SQL语言的设计与编写(下) --SELECT查询精讲 概要: SELECT[ALL | DISTINCT] #distinct 明显的,清楚的,有区别的 {*|table.*|[table.]fie ...
- Shell脚本的调试技术
编程中必不可少的一点就是调试,Shell脚本以其强大的功能令人向往,当然,它的强大之处不只是体现在语言的实现功能上,更强大的是它的调试功能,下面,我将以实例讲解Shell脚本的调试技术. 下面是我所用 ...