问题
I have a small problem, probably because I'm a newbie in Android development.
I am making an Air mobile App, with an Air Native Extension. My extension is used to create alarms. In my BroadcastReceiver I make an Intent to call my Air App. To make this call possible I had to add the activity in my Air App Manifest like this :
<manifestAdditions><![CDATA[
<manifest>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
<application>
<receiver android:name="com.atnetplanet.alarminterface.AlarmInterfaceBroadcastReceiver">
<intent-filter>
<action android:name="com.atnetplanet.alarminterface.AlarmInterfaceBroadcastReceiver.onReceive"/>
</intent-filter>
</receiver>
<activity android:name="air.com.atnetplanet.pikup.AppEntry" >
<intent-filter>
<action android:name="air.com.atnetplanet.pikup.AppEntry" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
]]>
Since I have added this activity in my manifest my app is awaken by my broadcast and everything is fine... except that the design of my app is changed : I have the name of the app above the actual screen (
I tried to make changes to the manifest, but wasn't able to remove this header without breaking my app.Does anyone can tell me what I'm doing wrong ?
Thanks.
回答1:
I answer to myself so if someone faces the same problem he can see an answer. The problem was in the AIR manifest. I had to change the declaration of the activity to this :
<manifest>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
<application>
<receiver android:name="com.atnetplanet.alarminterface.AlarmInterfaceBroadcastReceiver">
<intent-filter>
<action android:name="com.atnetplanet.alarminterface.AlarmInterfaceBroadcastReceiver.onReceive"/>
</intent-filter>
</receiver>
<activity>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="air.com.atnetplanet.pikup.AppEntry" />
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="pikup" />
</intent-filter>
</activity>
</application>
</manifest>
Note that the activity node doesn't have the name inserted, and that I must put the or I'll have a misformed Manifest error when compiling.
Hope it will help someone.
来源:https://stackoverflow.com/questions/24700674/air-app-adding-activity-to-manifest-changes-the-app-design