|
|
@@ -1,13 +1,14 @@
|
|
|
package com.xzjmyk.pm.activity.ui.circle;
|
|
|
|
|
|
+import android.annotation.TargetApi;
|
|
|
import android.app.Activity;
|
|
|
import android.app.AlertDialog;
|
|
|
import android.app.ProgressDialog;
|
|
|
-
|
|
|
import android.content.DialogInterface;
|
|
|
import android.content.Intent;
|
|
|
import android.net.Uri;
|
|
|
import android.os.AsyncTask;
|
|
|
+import android.os.Build;
|
|
|
import android.os.Bundle;
|
|
|
import android.text.TextUtils;
|
|
|
import android.util.Log;
|
|
|
@@ -20,7 +21,6 @@ import android.widget.EditText;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.ImageView.ScaleType;
|
|
|
import android.widget.TextView;
|
|
|
-import android.widget.Toast;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.android.volley.Response;
|
|
|
@@ -111,9 +111,9 @@ public class SendShuoshuoActivity extends BaseActivity implements View.OnClickLi
|
|
|
|
|
|
|
|
|
//判是否有从工作日报心得传来数据
|
|
|
- final Intent intent = getIntent();
|
|
|
+ final Intent intent = getIntent();
|
|
|
dailyexperience = intent.getStringExtra("Experience");
|
|
|
- if(!TextUtils.isEmpty(dailyexperience)){
|
|
|
+ if (!TextUtils.isEmpty(dailyexperience)) {
|
|
|
mTextEdit.setText(dailyexperience);
|
|
|
}
|
|
|
if (mType == 0) {
|
|
|
@@ -216,7 +216,8 @@ public class SendShuoshuoActivity extends BaseActivity implements View.OnClickLi
|
|
|
}
|
|
|
|
|
|
}
|
|
|
-//public void senddailyshuoshuo(String experience){
|
|
|
+
|
|
|
+ //public void senddailyshuoshuo(String experience){
|
|
|
//
|
|
|
//}
|
|
|
// 发布一条说说
|
|
|
@@ -236,10 +237,10 @@ public class SendShuoshuoActivity extends BaseActivity implements View.OnClickLi
|
|
|
// 消息隐私范围 0=不可见;1=朋友可见;2=粉丝可见;3=广场
|
|
|
params.put("visible", "3");
|
|
|
|
|
|
- if(!TextUtils.isEmpty(dailyexperience)){
|
|
|
+ if (!TextUtils.isEmpty(dailyexperience)) {
|
|
|
// params.put("text", mTextEdit.getText().toString()+"\n\n[来自:工作日报>工作心得分享]");// 消息内容
|
|
|
- params.put("text", mTextEdit.getText().toString()+"\t(我也去分享(^_^)/~~)\n\n");
|
|
|
- }else{
|
|
|
+ params.put("text", mTextEdit.getText().toString() + "\t(我也去分享(^_^)/~~)\n\n");
|
|
|
+ } else {
|
|
|
params.put("text", mTextEdit.getText().toString());// 消息内容
|
|
|
}
|
|
|
|
|
|
@@ -288,26 +289,26 @@ public class SendShuoshuoActivity extends BaseActivity implements View.OnClickLi
|
|
|
intent.putExtra(AppConstant.EXTRA_MSG_ID, result.getData());
|
|
|
setResult(RESULT_OK, intent);
|
|
|
|
|
|
- if(!TextUtils.isEmpty(dailyexperience)){
|
|
|
- new AlertDialog
|
|
|
- .Builder(mContext)
|
|
|
- .setCancelable(false) //设置点击对话框之外的对话框不消失
|
|
|
- .setTitle("分享成功")
|
|
|
- .setMessage("是否立即进入朋友圈查看")
|
|
|
- .setNegativeButton("编写日报", new DialogInterface.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- finish();
|
|
|
- }
|
|
|
- })
|
|
|
- .setPositiveButton("立即进入", new DialogInterface.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- Intent intent1 = new Intent(ct,BusinessCircleActivity.class);
|
|
|
- startActivity(intent1);
|
|
|
- }
|
|
|
- }).show();
|
|
|
- }else{
|
|
|
+ if (!TextUtils.isEmpty(dailyexperience)) {
|
|
|
+ new AlertDialog
|
|
|
+ .Builder(mContext)
|
|
|
+ .setCancelable(false) //设置点击对话框之外的对话框不消失
|
|
|
+ .setTitle("分享成功")
|
|
|
+ .setMessage("是否立即进入朋友圈查看")
|
|
|
+ .setNegativeButton("编写日报", new DialogInterface.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialog, int which) {
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .setPositiveButton("立即进入", new DialogInterface.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialog, int which) {
|
|
|
+ Intent intent1 = new Intent(ct, BusinessCircleActivity.class);
|
|
|
+ startActivity(intent1);
|
|
|
+ }
|
|
|
+ }).show();
|
|
|
+ } else {
|
|
|
finish();
|
|
|
}
|
|
|
}
|
|
|
@@ -319,6 +320,7 @@ public class SendShuoshuoActivity extends BaseActivity implements View.OnClickLi
|
|
|
|
|
|
private ProgressDialog mProgressDialog;
|
|
|
|
|
|
+ @TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
|
switch (view.getId()) {
|
|
|
@@ -336,7 +338,10 @@ public class SendShuoshuoActivity extends BaseActivity implements View.OnClickLi
|
|
|
if (mPhotoList.size() <= 0) {// 发文字
|
|
|
sendShuoshuo();
|
|
|
} else {// 图片+文字
|
|
|
- new UploadPhpto().execute();
|
|
|
+ if (Build.VERSION.SDK_INT >= 11)
|
|
|
+ new UploadPhpto().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
|
|
+ else
|
|
|
+ new UploadPhpto().execute();
|
|
|
}
|
|
|
break;
|
|
|
}
|