|
|
@@ -0,0 +1,55 @@
|
|
|
+package com.modular.apputils;
|
|
|
+
|
|
|
+import android.app.Activity;
|
|
|
+import android.content.Intent;
|
|
|
+import android.net.Uri;
|
|
|
+import android.os.Bundle;
|
|
|
+
|
|
|
+import com.common.LogUtil;
|
|
|
+import com.modular.apputils.activity.SimpleWebActivity;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @desc:负责分发外部URL链接的中转界面
|
|
|
+ * @author:Arison on 2018/1/9
|
|
|
+ */
|
|
|
+public class IntentUrlActivity extends Activity {
|
|
|
+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(this, SimpleWebActivity.class);
|
|
|
+ intent.putExtra("id",id);
|
|
|
+ intent.putExtra("url","https://www.baidu.com");
|
|
|
+ intent.putExtra("p","询价单");
|
|
|
+ startActivity(intent);
|
|
|
+ }
|
|
|
+ if ("B".equals(pagekind)){
|
|
|
+ Intent intent=new Intent(this, SimpleWebActivity.class);
|
|
|
+ intent.putExtra("id",id);
|
|
|
+ intent.putExtra("url","https://github.com");
|
|
|
+ intent.putExtra("p","公共询价单");
|
|
|
+ startActivity(intent);
|
|
|
+
|
|
|
+ }
|
|
|
+ if ("C".equals(pagekind)){
|
|
|
+ Intent intent=new Intent(this, SimpleWebActivity.class);
|
|
|
+ intent.putExtra("id",id);
|
|
|
+ intent.putExtra("url","https://www.jianshu.com/u/7cfc7246c714");
|
|
|
+ intent.putExtra("p","采购单");
|
|
|
+ startActivity(intent);
|
|
|
+ }
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|