close

 

 

 

 

public class AutoStart extends BroadcastReceiver{
 
    @Override
    public void onReceive(Context context, Intent intent) {
        // TODO Auto-generated method stub
         if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)){
                Intent i = new Intent(context, SochActivity.class);
                i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                context.startActivity(i);
            }
    }
 
}
 
 
<receiver
 android:name=".AutoStart"
 android:enabled="true"
 android:exported="true" >
 <intent-filter android:priority="500" >
  <action android:name="android.intent.action.BOOT_COMPLETED" />
 </intent-filter>
</receiver>
 
 
 
 
arrow
arrow
    全站熱搜

    小彬彬 發表在 痞客邦 留言(0) 人氣()