automatically run an application on Android phone startup

后端 未结 4 1416
一整个雨季
一整个雨季 2020-12-18 16:59

I want to start my application when phone startup

I just follow tutorial from here but it doesn\'t work in my device. Please see my method:

public c         


        
4条回答
  •  借酒劲吻你
    2020-12-18 17:43

    try like this....

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

    in manifest file...

     
                
                    
                    
                
            
    

提交回复
热议问题