is it possible to have more than two packages in one project android?
I’ve declared in queue manifest but the third packages is suddenly force close.. I really dont have any idea the reason..but here is my code for queue manifest :
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ike.doctors"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8"
android:targetSdkVersion="8"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".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>
<activity android:name=".MainMenuActivity"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar"></activity>
<activity android:name=".MenuRegisActivity"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar"></activity>
<activity android:name="com.ike.hospitalize.MenuHospitalizeActivity"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar"></activity>
<activity android:name="com.ike.hospitalize.MenuRoomCategoriesActivity"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar"></activity>
<activity android:name="com.ike.emergency.MenuRegisAActivity"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar"></activity>
<activity android:name="com.ike.emergency.MenuEmergencyActivity"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar"></activity>
</application>
</manifest>
com.emergency.MenuEmergencyActivity is force close..
here is the log cat :
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ike.doctors/com.ike.emergency.MenuEmergencyActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.ike.emergency.MenuEmergencyActivity.onCreate(MenuEmergencyActivity.java:41)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
does anyone can solve my problem?
thx you
It is not possible to have two or more packages in the manifest. The
packageattribute in the manifest is used by the Android OS to uniquely identify your application.It is possible to have more than two activities. Each activity defines an UI entry point into your application, and you can have as many of these as you want.
Your particular problem is not caused by the fact that you have more than two activities. It’s just that one of your activity has a bug somewhere in its code. Specifically, the
MenuEmergencyActivitycrashes because of a bug on line 41, as the logcat output suggests:at com.ike.emergency.MenuEmergencyActivity.onCreate(MenuEmergencyActivity.java:41I would make a wild guess and say your
onCreateis usingfindViewByIdto get specific UI element, which is not present in the layout, and you’re trying to use that element without checking if it was found.