My Android Program Runs on Emulator, but not on Galaxy S3
<p>When I run my program on Android Emulator, it runs, but on Samsung Galaxy S3, it won't.
I mean, when I install the .apk on my emulator, it's successful. when my emulator reboots, the app runs. but when I install it on galaxy s3, it successfully installed and I can open it without any problems, but when I reboot my galaxy s3, it won't automatically open.</p>

<p>I think it's because my android emulator uses Android Version 2.2 and my S3 is using Android Version 4.0.4</p>

<p>My app is simple; every time the phone starts, my program starts.</p>

<p>This app's SDK build is "4.1 API 16".</p>

<p>Here's my code.</p>

<p><strong>Manifest.xml</strong></p>

<pre><code> &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.onboot"
    android:versionCode="1"
    android:versionName="1.0" &gt;
&lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /&gt;
    &lt;uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="15" /&gt;
    &lt;application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" &gt;

        &lt;receiver android:name=".LaunchAppBroadcast"
            android:permission="android.permission.RECEIVE_BOOT_COMPLETED"&gt;
            &lt;intent-filter&gt;
                &lt;action android:name="android.intent.action.BOOT_COMPLETED"/&gt;
            &lt;/intent-filter&gt;
        &lt;/receiver&gt;
        &lt;activity
            android:name=".OnBoot"
            android:label="@string/title_activity_on_boot" &gt;
            &lt;intent-filter&gt;
                &lt;action android:name="android.intent.action.MAIN" /&gt;

                &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;
    &lt;/application&gt;

&lt;/manifest&gt;
</code></pre>

<p>I got a java file.</p>

<p><strong>OnBoot.java</strong></p>

<pre><code>public class OnBoot extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_on_boot);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.activity_on_boot, menu);
    return true;
}
</code></pre>

<p>}</p>

<p>and <strong>LaunchAppBroadcast.java</strong></p>

<pre><code>public class LaunchAppBroadcast extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {
    // TODO Auto-generated method stub
    Intent intent2 = new Intent(context, OnBoot.class);
    intent2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(intent2);

}

 }
</code></pre>

<p>That's it. Once Again, this already works on android emulator. </p>

<p>And I made a new project again now using BUILD SDK "4.0 API 14", still it works with the emulator but not with my galaxy </p>
