maoruibin / maoruibin/maoruibin.github.com
重启 App 的优雅实现方式(利用AlarmManager 设置一个定时 PendingIntent 实现)
Open
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 22
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
Intent mStartActivity = new Intent(context, MainActivity.class);
int mPendingIntentId = 123456;
PendingIntent mPendingIntent = PendingIntent.getActivity(context, mPendingIntentId, mStartActivity, PendingIntent.FLAG_CANCEL_CURRENT);
AlarmManager mgr = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100, mPendingIntent);
System.exit(0);
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue contains only a Java snippet using MainActivity, PendingIntent, AlarmManager, and System.exit(0); no repository file or test is named. Start by determining the intended change and locating any Android app entry point in the project. Done should be defined as an agreed, graceful app-restart behavior, but the issue does not specify acceptance criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100