zoukankan      html  css  js  c++  java
  • eclipse安卓引入库项目的正确方法

    之前清单文件里theme主题老是改不成库项目里定义好的主题@style/Theme.AppCompat.Light,只能用默认主题@style/AppTheme

        <application
            android:name="com.example.googleplay.global.GooglePlayApplication"
            android:allowBackup="true"
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            android:theme="@style/Theme.AppCompat.Light" >
            <activity
                android:name="com.example.googleplay.ui.activity.MainActivity"
                android:label="@string/app_name" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        </application>

    找了半天也没发现什么问题,库项目也导入了啊,为什么不能用库项目里定义的东西

    原来我是用的java build path的方法导入库项目,错误做法如下

     

    原来安卓导入库项目跟一般的java导入项目的方法不同,安卓的导入方法(在项目上右键,选择properties,再选择Android,在Library那里add库项目即可):

     安卓导入的方法不同是因为安卓还需要除了代码的引用之外,还要用到库项目里已有的资源(layout,themes,strings,dimens,colors,styles等);而java引入库项目只是为了用库项目里的方法

  • 相关阅读:
    第四周助教小结
    java课程总结
    第十四周总结
    第十三周实验报告
    第十二周课程报告
    第十一周课程总结
    第十周课程总结
    第九周课程总结&实验报告(七)
    第八周课程总结&实验报告(六)
    第七周课程总结&实验报告(五)
  • 原文地址:https://www.cnblogs.com/johnsonwei/p/5657080.html
Copyright © 2011-2022 走看看