https://github.com/justson/pixel-activity-keep-alive
This is android keep alive library,Using a pixel activity to keep process alive.
https://github.com/justson/pixel-activity-keep-alive
Last synced: 9 months ago
JSON representation
This is android keep alive library,Using a pixel activity to keep process alive.
- Host: GitHub
- URL: https://github.com/justson/pixel-activity-keep-alive
- Owner: Justson
- License: apache-2.0
- Created: 2017-03-11T03:23:59.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-12-22T10:20:10.000Z (over 7 years ago)
- Last Synced: 2025-04-13T22:45:54.234Z (about 1 year ago)
- Language: Java
- Homepage:
- Size: 66.4 KB
- Stars: 25
- Watchers: 2
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## 通过一个像素的activity保活
### 使用
* Gradle
```
compile 'com.just.library:pixel:1.0.0'
```
* Maven
```
com.just.library
pixel
1.0.0
pom
```
### 引入
```
PixelActivityUnion
.with(App.mContext)
.targetActivityClazz(PointActivity.class)//
.args(null)//
.setActiviyManager(ActivityManager.getInstance())
.start();
```
### 关闭
```
PixelActivityUnion.quit();
```
### 别忘了配置AndroidManifest
```
```
### 自定义IActivityManager和Activity
IActivityManager是对Activity进行管理的一个接口, 比如启动和销毁,所以根据自己需要重写Add和Remove.
Activity 最好让用户无法感知整过过程, 所以建议Activity尽量小化和透明化.