Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewleo committed Jul 2, 2013
1 parent 2fe0617 commit 2771437
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Binary file added libs/android-support-v4.jar
Binary file not shown.
15 changes: 13 additions & 2 deletions src/com/netease/qa/emmagee/service/EmmageeService.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.util.Properties;

import android.app.Activity;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
Expand All @@ -37,6 +38,7 @@
import android.os.Build;
import android.os.Handler;
import android.os.IBinder;
import android.support.v4.app.NotificationCompat;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
Expand All @@ -50,6 +52,7 @@
import android.widget.TextView;
import android.widget.Toast;

import com.netease.qa.emmagee.activity.MainPageActivity;
import com.netease.qa.emmagee.utils.CpuInfo;
import com.netease.qa.emmagee.utils.EncryptData;
import com.netease.qa.emmagee.utils.MailSender;
Expand Down Expand Up @@ -117,8 +120,15 @@ public void onCreate() {
@Override
public void onStart(Intent intent, int startId) {
Log.i(LOG_TAG, "onStart");
setForeground(true);
super.onStart(intent, startId);
PendingIntent contentIntent = PendingIntent.getActivity(
getBaseContext(), 0, new Intent(this, MainPageActivity.class),
0);
NotificationCompat.Builder builder = new NotificationCompat.Builder(
this);
builder.setContentIntent(contentIntent).setSmallIcon(R.drawable.icon)
.setWhen(System.currentTimeMillis()).setAutoCancel(true)
.setContentTitle("Emmagee");
startForeground(startId, builder.build());

pid = intent.getExtras().getInt("pid");
uid = intent.getExtras().getInt("uid");
Expand Down Expand Up @@ -441,6 +451,7 @@ public void onDestroy() {
}

super.onDestroy();
stopForeground(true);
}

@Override
Expand Down

0 comments on commit 2771437

Please sign in to comment.