|
@@ -1,7 +1,10 @@
|
|
|
package com.uas.appme.pedometer.view;
|
|
package com.uas.appme.pedometer.view;
|
|
|
|
|
|
|
|
|
|
+import android.content.ComponentName;
|
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
|
|
|
+import android.content.ServiceConnection;
|
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
|
|
|
+import android.os.IBinder;
|
|
|
import android.util.Log;
|
|
import android.util.Log;
|
|
|
import android.view.Gravity;
|
|
import android.view.Gravity;
|
|
|
import android.view.LayoutInflater;
|
|
import android.view.LayoutInflater;
|
|
@@ -65,7 +68,7 @@ public class PersonalPageActivity extends BaseActivity implements View.OnClickLi
|
|
|
private PersonalStepBean mPersonalStepBean;
|
|
private PersonalStepBean mPersonalStepBean;
|
|
|
private Button mbtnAttention;
|
|
private Button mbtnAttention;
|
|
|
private LineChartView lineChart;
|
|
private LineChartView lineChart;
|
|
|
- private String shareStepStr = "分享了UU运动内容给你";
|
|
|
|
|
|
|
+ private String shareStepStr = "我正在使用UU运动计步功能,你也一起来吧";
|
|
|
private ImageView share_bitmap_im;
|
|
private ImageView share_bitmap_im;
|
|
|
private LinearLayout line_chart_ll;
|
|
private LinearLayout line_chart_ll;
|
|
|
private int my_rank;
|
|
private int my_rank;
|
|
@@ -75,10 +78,16 @@ public class PersonalPageActivity extends BaseActivity implements View.OnClickLi
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
super.onCreate(savedInstanceState);
|
|
|
setContentView(R.layout.personal_page_activity);
|
|
setContentView(R.layout.personal_page_activity);
|
|
|
|
|
+ bindService(CoreService.getIntent(), mConnection, BIND_AUTO_CREATE);
|
|
|
initView();
|
|
initView();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ protected void onDestroy() {
|
|
|
|
|
+ super.onDestroy();
|
|
|
|
|
+ unbindService(mConnection);
|
|
|
|
|
+ }
|
|
|
private void initView() {
|
|
private void initView() {
|
|
|
Intent intent = getIntent();
|
|
Intent intent = getIntent();
|
|
|
title = intent.getStringExtra("title");
|
|
title = intent.getStringExtra("title");
|
|
@@ -321,7 +330,7 @@ public class PersonalPageActivity extends BaseActivity implements View.OnClickLi
|
|
|
startActivity(intent);
|
|
startActivity(intent);
|
|
|
closePopupWindow();
|
|
closePopupWindow();
|
|
|
}else if (v.getId() == R.id.not_rankingwith_tv){
|
|
}else if (v.getId() == R.id.not_rankingwith_tv){
|
|
|
- ToastMessage("not_rankingwith_tv");
|
|
|
|
|
|
|
+// ToastMessage("not_rankingwith_tv");
|
|
|
closePopupWindow();
|
|
closePopupWindow();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -334,10 +343,20 @@ public class PersonalPageActivity extends BaseActivity implements View.OnClickLi
|
|
|
String ownerId = MyApplication.getInstance().mLoginUser.getUserId();
|
|
String ownerId = MyApplication.getInstance().mLoginUser.getUserId();
|
|
|
String ownerName = CommonUtil.getSharedPreferences(MyApplication.getInstance(), "erp_emname");
|
|
String ownerName = CommonUtil.getSharedPreferences(MyApplication.getInstance(), "erp_emname");
|
|
|
String objectId = model.getImid();
|
|
String objectId = model.getImid();
|
|
|
- mService = new CoreService();
|
|
|
|
|
StepUtils.sendMessage(mService,ownerId,ownerName,objectId,shareStepStr);
|
|
StepUtils.sendMessage(mService,ownerId,ownerName,objectId,shareStepStr);
|
|
|
LogUtil.d("0x01",JSON.toJSONString(model));
|
|
LogUtil.d("0x01",JSON.toJSONString(model));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ private ServiceConnection mConnection = new ServiceConnection() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onServiceDisconnected(ComponentName name) {
|
|
|
|
|
+ mService = null;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onServiceConnected(ComponentName name, IBinder service) {
|
|
|
|
|
+ mService = ((CoreService.CoreServiceBinder) service).getService();
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
}
|
|
}
|