Skip to content

Commit

Permalink
Fixed Bags
Browse files Browse the repository at this point in the history
  • Loading branch information
NesterovichAlexey committed May 29, 2017
1 parent 7998fd2 commit 9b9b291
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public void onDestroy() {

@Override
public int onStartCommand(Intent intent, int flags, int startId) {
this.pi = intent.getParcelableExtra("pendingIntent");
if (intent != null)
this.pi = intent.getParcelableExtra("pendingIntent");
if (run != null)
run.stop();
es.execute(run = new MyRun());
Expand Down Expand Up @@ -91,6 +92,8 @@ private void sendImage() {
if (size != 0)
intent.putExtra("imageFileName", (cur % size) + ".png");
try {
if (pi == null)
return;
pi.send(MyService.this, 0, intent);
lastSendImage = System.currentTimeMillis();
preference.edit().putLong(LAST_SEND_IMAGE, lastSendImage).apply();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ private void initApp() {
App newApp = new App(name, packageName, icon, timeInstalled);
addApp(newApp);
}
ArrayList<App> list = (ArrayList<App>) getAppsList().clone();
for (App app1 : list) {
if (app1.getIcon() == null)
removeApp(app1.getPackageName());
}
}

public void addApp(@NonNull App app) {
Expand Down

0 comments on commit 9b9b291

Please sign in to comment.