|
|
@@ -4,50 +4,76 @@ import android.app.Activity;
|
|
|
import android.content.Intent;
|
|
|
import android.net.Uri;
|
|
|
import android.os.Bundle;
|
|
|
+import android.os.Handler;
|
|
|
|
|
|
import com.common.LogUtil;
|
|
|
+import com.common.system.ActivityUtils;
|
|
|
+import com.core.app.Constants;
|
|
|
|
|
|
/**
|
|
|
* @desc:负责分发外部URL链接的中转界面
|
|
|
* @author:Arison on 2018/1/9
|
|
|
*/
|
|
|
public class IntentUrlActivity extends Activity {
|
|
|
-private static final String TAG = "IntentUrlActivity";
|
|
|
+ private static final String TAG = "IntentUrlActivity";
|
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
|
setContentView(R.layout.activity_intent_url);
|
|
|
- Intent i_getvalue = getIntent();
|
|
|
- String action = i_getvalue.getAction();
|
|
|
- if(Intent.ACTION_VIEW.equals(action)){
|
|
|
- Uri uri = i_getvalue.getData();
|
|
|
- if(uri != null){
|
|
|
- String pagekind = uri.getQueryParameter("pagekind");
|
|
|
- String id= uri.getQueryParameter("id");
|
|
|
- LogUtil.d(TAG,"pagekind:"+pagekind+" id:"+id);
|
|
|
- if ("A".equals(pagekind)){
|
|
|
- Intent intent=new Intent("com.modular.work.platform.activity.CustomerInquiryDetailActivity");
|
|
|
-
|
|
|
- intent.putExtra("extra_b2b_list_id",id);
|
|
|
- intent.putExtra("extra_b2b_list_state","todo");
|
|
|
- startActivity(intent);
|
|
|
- }
|
|
|
- if ("B".equals(pagekind)){//公共询价单
|
|
|
- Intent intent=new Intent("com.modular.work.platform.activity.CustomerInquiryDetailActivity");
|
|
|
- intent.putExtra("extra_b2b_list_id",id);
|
|
|
- intent.putExtra("extra_b2b_list_state","public_todo");
|
|
|
- startActivity(intent);
|
|
|
-
|
|
|
+ final Intent i_getvalue = getIntent();
|
|
|
+ final String action = i_getvalue.getAction();
|
|
|
+ final boolean isOpenApp= ActivityUtils.isRunningInForeground();
|
|
|
+ LogUtil.d(TAG,"isOpenApp:"+isOpenApp);
|
|
|
+ if (isOpenApp){
|
|
|
+ openIntentUrl(action, i_getvalue);
|
|
|
+ }else{
|
|
|
+ startActivity(new Intent("com.modular.main.MainActivity"));
|
|
|
+ new Handler().postDelayed(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ openIntentUrl(action, i_getvalue);
|
|
|
}
|
|
|
- if ("C".equals(pagekind)){
|
|
|
- Intent intent=new Intent("com.modular.work.platform.activity.PurchaseDetailsActivity");
|
|
|
- intent.putExtra("extra_b2b_list_id",id);
|
|
|
- intent.putExtra("extra_b2b_list_state","todo");
|
|
|
- startActivity(intent);
|
|
|
+ },200);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void openIntentUrl(String action, Intent i_getvalue) {
|
|
|
+ try {
|
|
|
+ if(Intent.ACTION_VIEW.equals(action)){
|
|
|
+ Uri uri = i_getvalue.getData();
|
|
|
+ if(uri != null){
|
|
|
+ String pagekind = uri.getQueryParameter("pagekind");
|
|
|
+ String id= uri.getQueryParameter("id");
|
|
|
+ String enuu= uri.getQueryParameter("uu");
|
|
|
+ LogUtil.d(TAG,"pagekind:"+pagekind+" id:"+id+" enuu:"+enuu);
|
|
|
+ if ("A".equals(pagekind)){
|
|
|
+ Intent intent=new Intent("com.modular.work.platform.activity.CustomerInquiryDetailActivity");
|
|
|
+ intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_ID ,id);
|
|
|
+ intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_STATE,"todo");
|
|
|
+ intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_ENUU,enuu);
|
|
|
+ startActivity(intent);
|
|
|
+ }
|
|
|
+ if ("B".equals(pagekind)){//公共询价单
|
|
|
+ Intent intent=new Intent("com.modular.work.platform.activity.CustomerInquiryDetailActivity");
|
|
|
+ intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_ID ,id);
|
|
|
+ intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_STATE,"public_todo");
|
|
|
+ intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_ENUU,enuu);
|
|
|
+ startActivity(intent);
|
|
|
+
|
|
|
+ }
|
|
|
+ if ("C".equals(pagekind)){
|
|
|
+ Intent intent=new Intent("com.modular.work.platform.activity.PurchaseDetailsActivity");
|
|
|
+ intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_ID ,id);
|
|
|
+ intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_STATE,"todo");
|
|
|
+ intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_ENUU,enuu);
|
|
|
+ startActivity(intent);
|
|
|
+ }
|
|
|
+ overridePendingTransition(0,0);
|
|
|
+ finish();
|
|
|
}
|
|
|
- overridePendingTransition(0,0);
|
|
|
- finish();
|
|
|
}
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
}
|