The right way to introduce a library project to Android

Source: Internet
Author: User

Before the Theme theme in the inventory file is always changed to the theme @style/theme.appcompat.light defined in the library project, you can only use the default theme @style/apptheme

    <ApplicationAndroid: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" >        <ActivityAndroid:name= "Com.example.googleplay.ui.activity.MainActivity"Android:label= "@string/app_name" >            <Intent-filter>                <ActionAndroid:name= "Android.intent.action.MAIN" />                <categoryAndroid:name= "Android.intent.category.LAUNCHER" />            </Intent-filter>        </Activity>    </Application>

Looking for a long while did not find any problem, the library project also imported Ah, why can not use the library project definition of Things

Originally I used the Java build Path method to import the library project, the error is as follows

The original Android import library project with the General Java Import Project method is different, the method of the introduction of Android (right-click on the project, select Properties, and then select Android, in the Library Add Libraries Project can be):

The way Android is imported is different because Android also needs to use the resources (layout,themes,strings,dimens,colors,styles, etc.) that are already in the library project in addition to the code references, and the Java Import Project is just for the purpose of using the methods in the Library project.

The right way to introduce a library project to Android

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.