How to launch an Activity without a UI?

后端 未结 11 1656
失恋的感觉
失恋的感觉 2020-11-30 17:48

Is it in any way possible to launch an activity from the main function without having a UI? i.e. is there a way to create a sort of \"wrapper\" around another activity, i.e.

11条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-30 18:37

    Using

    
    

    mentioned by Brian515 works great. This method is useful for creating an entry point Activity that decides on which activity to call, start, services, etc without having to show a UI to the user. Remember to use finish() after you have started your intent.

提交回复
热议问题