Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start My own Activity instead of mobile home screen as soon as boot completes android?

Tags:

android

After boot completion i want to load my own activity as first screen instead of mobile home screen.There is a delay happening in between so how to solve this...thanks in advance.....

like image 535
raj Avatar asked Oct 24 '25 19:10

raj


1 Answers

check this: OtaStartupReceiver

this class is Phone apk source code in android source, please check method private boolean shouldPostpone(Context context)

On devices that provide a phone initialization wizard (such as Google Setup Wizard), we allow delaying CDMA OTA setup so it can be done in a single wizard. The wizard is responsible for

(1) disabling itself once it has been run and/or

(2) setting the 'device_provisioned' flag to something non-zero and

(3) calling the OTA Setup with the action below. NB: Typical phone initialization wizards will install themselves as the homescreen (category "android.intent.category.HOME") with a priority higher than the default. The wizard should set 'device_provisioned' when it completes, disable itself with the PackageManager.setComponentEnabledSetting() and then start home screen.

as above shown:

you can create a activity in AndroidManifest.xml

    <activity
        android:name=".Demo"
        android:label="@string/app_name"
        android:screenOrientation="portrait" >
        <!--android:priority added-->
        <!--category.HOME and DEVICE_INITIALIZATION_WIZARD must have-->
        <intent-filter android:priority="1000">
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.HOME"/>
            <action android:name="android.intent.action.DEVICE_INITIALIZATION_WIZARD"/>
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
like image 97
idiottiger Avatar answered Oct 26 '25 09:10

idiottiger