2013-07-17 31 views
0

我有2個Android項目,其中1個可以是AndroidLibrary項目。在這種情況下,有時我應該將活動添加到清單文件中。我必須通過ant build script來完成。 例子:添加活動以顯示螞蟻

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="ru.yes.app1" 
    android:versionCode="1" 
    android:versionName="1.0" > 

    <uses-sdk 
     android:minSdkVersion="8" 
     android:targetSdkVersion="17" /> 

    <application 
     android:allowBackup="true" 
     android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" 
     android:theme="@style/AppTheme" > 
     <activity 
      android:name="ru.yes.app1.Activity1" 
      android:label="@string/app_name" > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
      <intent-filter> 
       <action android:name="ru.yes.app1.ACTIVITY1" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
      </intent-filter> 
     </activity> 
    </application> 

</manifest> 

,並說到:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="ru.yes.app1" 
    android:versionCode="1" 
    android:versionName="1.0" > 

    <uses-sdk 
     android:minSdkVersion="8" 
     android:targetSdkVersion="17" /> 

    <application 
     android:allowBackup="true" 
     android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" 
     android:theme="@style/AppTheme" > 
     <activity 
      android:name="ru.yes.app1.Activity1" 
      android:label="@string/app_name" > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
      <intent-filter> 
       <action android:name="ru.yes.app1.ACTIVITY1" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
      </intent-filter> 
     </activity> 
     <activity 
      android:name="ru.yes.app2.Activity2" 
      android:label="@string/app_name" > 
      <intent-filter> 
       <action android:name="ru.yes.app1.ACTIVITY2" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
      </intent-filter> 
     </activity> 
    </application> 

</manifest> 

如何我可以用螞蟻的build.xml做到這一點。

回答