开发者

How do I load an Activity from within a Library?

开发者 https://www.devze.com 2023-04-02 10:44 出处:网络
I\'ve got a projected marked as \"Is Library\" - it has all the activities. I\'ve got a new Android project that references this library.How do I mark one of my library\'s activities as the first one

I've got a projected marked as "Is Library" - it has all the activities. I've got a new Android project that references this library. How do I mark one of my library's activities as the first one that starts up?

EDIT

My original manifest looks like this:

<activity android:name=".Welcome" android:label="@string开发者_如何学Python/app_name" android:theme="@android:style/Theme.NoTitleBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

All my activities are in the package com.rjs.animator.


As long as you AndroidManifest.xml contain those Activity tag and reference to the correct namespace/class within your Library, you should be good to go.


You have to add all activities and other components to the new Android project's manifest, with whatever <intent-filter> elements you want. Just put the standard MAIN/LAUNCHER <intent-filter> on whichever activity you want.

0

精彩评论

暂无评论...
验证码 换一张
取 消