<receiver android:name="HippoStartupIntentReceiver"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED"/> <category android:name="android.intent.category.HOME"/> </intent-filter> </receiver>
Android 界面竖设置
Mainfest.xml
<activity android:name=".AndroidNet2Activity"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:screenOrientation="landscape"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
public class HippoStartupIntentReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
Intent mBootIntent = new Intent(context, AndroidNet2Activity.class);
mBootIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(mBootIntent);
}
}
开机启动xml代码
本文介绍了如何在Android应用中实现开机自启动的功能,并展示了具体的XML配置代码与BroadcastReceiver类的实现方式。此外,还提供了将应用界面设置为横屏显示的方法。
552

被折叠的 条评论
为什么被折叠?



