0

Possible Duplicate:
Autostart application while phone boots up

This seems like a fairly simple question but I have not been able to find an answer.

I've been looking at getting tablets for my business, however, I want them to boot straight to an App.

If I'm not saying that right, I mean, every time I turn on the device, I want it to load straight to 'Angry Birds' (or my developed app). Is this possible, and if so, is it widely known how?

Thanks!

Community
  • 1
  • 1

2 Answers2

5

Make your app be the home screen, by adding the HOME category to your activity's <intent-filter>:

<intent-filter>
 <action android:name="android.intent.action.MAIN" />
 <category android:name="android.intent.category.HOME" />
 <category android:name="android.intent.category.DEFAULT" />
</intent-filter>
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
0

Use BOOT_COMPLETED Reciever and start your Activity inside

Edit: Use code like below

public class MyBroadcastreceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        Intent startIntent = new Intent(context, MyActivity.class);
        context.startActivity(startIntent);
    }
}

And in your Mandifest

<receiver android:name="com.example.MyBroadcastReceiver">  
    <intent-filter>  
        <action android:name="android.intent.action.BOOT_COMPLETED" />  
    </intent-filter>  
</receiver>
nandeesh
  • 24,740
  • 6
  • 69
  • 79
  • This will be unreliable, as you might launch your activity before the home screen activity comes to the foreground. – CommonsWare Aug 26 '12 at 15:42