0

他の2つのアプリケーションに共通のアクティビティを定義するライブラリプロジェクトがあります。コードの重複を避けるために、ライブラリプロジェクトの両方のアプリケーションに共通のログインアクティビティを定義し、そのログインアクティビティが両方のアプリケーションのランチャーアクティビティになります。 、私の問題は、メインアプリケーションマニフェストで他の(ライブラリ)プロジェクトからランチャーアクティビティをどのように定義するかということです。

出来ますか?

4

2 に答える 2

1

他のパッケージのアクティビティを追加するのと同じように、ライブラリのアクティビティをマニフェストに追加できます。

   <activity android:name=".someActivity" >
</activity>
<activity android:name="com.android.package1.VideoPlayer" >
</activity>
<activity android:name="com.android.libpackage2.LibActivity" >
</activity>    
于 2012-09-07T12:42:43.917 に答える
0

プロジェクトをライブラリとして定義するには、「project.properties」ファイルを使用します。

これは、ライブラリのproject.propertiesファイルのサンプルです。

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "ant.properties", and override values to adapt the script to your
# project structure.

android.library=true
# Project target.
target=android-10
于 2012-09-07T09:27:43.730 に答える