|
|
@@ -14,6 +14,7 @@ import android.text.TextUtils;
|
|
|
import android.util.Log;
|
|
|
import android.view.View;
|
|
|
import android.widget.Button;
|
|
|
+import android.widget.ImageView;
|
|
|
import android.widget.RelativeLayout;
|
|
|
import android.widget.TextView;
|
|
|
import android.widget.Toast;
|
|
|
@@ -60,7 +61,8 @@ public class SettingActivity extends ActionBackActivity implements View.OnClickL
|
|
|
|
|
|
@ViewInject(R.id.uu_step_rl)
|
|
|
private RelativeLayout uu_step_rl;
|
|
|
-
|
|
|
+ @ViewInject(R.id.uu_step_im)
|
|
|
+ private ImageView uu_step_im;
|
|
|
@ViewInject(R.id.uu_step_reply)
|
|
|
private SwitchView uu_step_reply;
|
|
|
|
|
|
@@ -133,13 +135,11 @@ public class SettingActivity extends ActionBackActivity implements View.OnClickL
|
|
|
uas_website_tv.setText(CommonUtil.getSharedPreferences(this, "erp_baseurl"));
|
|
|
|
|
|
|
|
|
- //UU开关的根据StepService是否开启显示状态
|
|
|
+ //UU开关的 根据StepService是否开启显示状态
|
|
|
int isStep = PreferenceUtils.getInt(MyApplication.getInstance(), MainActivity.UU_STEP);
|
|
|
|
|
|
- if (isServiceRunning(uustep_service_name)){
|
|
|
+ if (isServiceRunning(uustep_service_name)&&(isStep == -1 || isStep == 1)){
|
|
|
uu_step_reply.setChecked(true);
|
|
|
- uu_step_reply.setFocusable(false);
|
|
|
- uu_step_reply.setClickable(false);
|
|
|
}else {
|
|
|
uu_step_reply.setChecked(false);
|
|
|
}
|
|
|
@@ -150,8 +150,7 @@ public class SettingActivity extends ActionBackActivity implements View.OnClickL
|
|
|
if (isChecked) {
|
|
|
PreferenceUtils.putInt(MainActivity.UU_STEP, 1);
|
|
|
PushManager.resumeWork(MyApplication.getInstance());
|
|
|
- uu_step_reply.setFocusable(false);
|
|
|
- uu_step_reply.setClickable(false);
|
|
|
+ Toast.makeText(mContext, "您已开启UU运动", Toast.LENGTH_LONG).show();
|
|
|
startActivity(new Intent(mContext, MyPedometerActivity.class));
|
|
|
} else {
|
|
|
PushManager.stopWork(MyApplication.getInstance());
|
|
|
@@ -174,7 +173,7 @@ public class SettingActivity extends ActionBackActivity implements View.OnClickL
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- private boolean isServiceRunning(String servicename) { //判断某个服务是否已经运行
|
|
|
+ private boolean isServiceRunning(String servicename) { // 判断某个服务是否已经运行
|
|
|
ActivityManager manager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
|
|
|
for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
|
|
|
if (servicename.equals(service.service.getClassName())) {
|