如何让android系统一启动,就显示自已写的应用界面?

解决方案 »

  1.   

    监听 广播 RECEIVE_BOOT_COMPLETED,然后再启动应用就行了。
      

  2.   

    在manifest.xml中注册广播
    <receiver android:name=".BootBroadcastReceiver">
    <intent-filter>
                    <actionandroid:name="android.intent.action.BOOT_COMPLETED" />
    </intent-filter>
    </receiver>
    BootBroadcastReceiver启动你的应用界面
      

  3.   

    很简单,我们只要实现开机自启动即可,android实现开机自启动可能是移动操作系统中最简单的了,我们只需要监听一个开机启动的 Broadcast(广播)即可。首先写一个Receiver(即广播监听器),继承BroadcastReceiver,如下所示:
    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>
      

  4.   

    比WinCE 麻烦多了. winCE下, 开机自启动程序 是由操作系统加载的.=====================================
    这些代码是加在什么地方?
    ( 加在要启动的程序里?  )