如何让android系统一启动,就显示自已写的应用界面?
解决方案 »
- Android ImageView控件显示自己生成的图片
- android使用sqlite数据库需要下载sqlite软件吗
- 安卓虚拟机修改IEMI
- 关于U8500刷成2.2版的铃声问题
- 为什么ImageButton显示出来的尺寸比资源图片的尺寸小?求指点,感谢
- 关于Android开发中数据库替换的问题
- android 新建项目manifest报错
- 安卓是不是可以盗链任何网上的图片?
- sos 关于Gridview动画的
- 【求助】一个APP在data/app下创建的XML,如何在另一个APP中调用
- android源码导入eclipse,framework层如果是通过实现aidl接口的函数无法实现单步调试
- Android 3G新一代智能手机开发技术学习辅导!
<receiver android:name=".BootBroadcastReceiver">
<intent-filter>
<actionandroid:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
BootBroadcastReceiver启动你的应用界面
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;public class BootReceiver extends BroadcastReceiver{
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
//如果开机启动完成则启动你的应用界面
if(intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)){
Intent splash=new Intent(context,SplashScreen.class);
splash.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(splash);
}
}
}
接着在应用程序配置文件AndroidManifest.xml中注册这个Receiver来监听系统启动事件
<receiver android:name=".BootReceiver">
<intent-filter>
<!-- 系统启动完成后会调用-->
<action android:name="android.intent.action.BOOT_COMPLETED">
</action>
</intent-filter>
</receiver>
这些代码是加在什么地方?
( 加在要启动的程序里? )