java - 安卓 2.2 : How to make an app to run automaticly on startup & how to make an app start another app

标签 java android autostart bootcompleted

主题几乎说明了一切。

最佳答案

使用 BroadcastReceiver 接收 Action BOOT_COMPLETED 的 Intent。

在 onReceive() 方法中为您的 Activity 创建一个 Intent:

@Override
public void onReceive(Context context, Intent intent) {

 Intent myIntent = new Intent(context, YourActivity.class);
 context.startActivity(myIntent);
}

关于java - 安卓 2.2 : How to make an app to run automaticly on startup & how to make an app start another app,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4554583/

相关文章:

java - Android 从另一个类启动 Activity

java - 对整数列表上的多个属性进行排序

java - 为线程编写一个舒适的暂停/停止方法

java - 谷歌 LVL(许可证验证库): is it possible to run the app on a device without Google Play?

android - 辅助功能 : Talkback, WebView 和用户的区域设置

linux - 如何添加 shell 脚本中包含的标志?

java - CXF 用户名 token 问题

android - Clojure android 无法读取文件

linux - 仅在当天首次登录时运行 Linux 图形程序

Android 自动启动应用程序