如何让android系统一启动,就显示自已写的应用界面?
解决方案 »
- 在android中调用jni,出现ReferenceTable overflow (max=1024)
- 求教关于MediaScannerConnection
- Android阅读pdf的第三方类库
- 图像识别主要用到哪些技术
- [转载20111005]完美版Android系统源代码新下载地址
- RadioGroup传值取值?
- 豆瓣网android的手机端 后台服务
- opengl多纹理贴图 真机运行无效
- 请教大家一个入门的问题
- ListView中Button无法点击
- 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>
这些代码是加在什么地方?
( 加在要启动的程序里? )