1717import android .app .Activity ;
1818import android .content .Context ;
1919import android .content .Intent ;
20- import android .content .SharedPreferences ;
2120import android .os .Bundle ;
22- import android .os .Handler ;
2321import android .view .MotionEvent ;
2422import android .view .View ;
2523import android .view .Window ;
3129
3230import apijson .demo .R ;
3331import apijson .demo .application .DemoApplication ;
34- import zuo .biao .apijson .JSON ;
3532
3633
3734/**自动 UI 测试,需要用 UIAuto 发请求到这个设备
@@ -118,7 +115,6 @@ public static Intent createIntent(Context context, String list) {
118115
119116 private JSONArray touchList ;
120117
121- SharedPreferences cache ;
122118 private long flowId = 0 ;
123119 @ Override
124120 protected void onCreate (Bundle savedInstanceState ) {
@@ -132,7 +128,7 @@ protected void onCreate(Bundle savedInstanceState) {
132128
133129
134130 flowId = getIntent ().getLongExtra (INTENT_FLOW_ID , flowId );
135- touchList = JSON .parseArray (getIntent ().getStringExtra (INTENT_TOUCH_LIST ));
131+ //太卡 touchList = JSON.parseArray(getIntent().getStringExtra(INTENT_TOUCH_LIST));
136132
137133//
138134// DisplayMetrics outMetrics = new DisplayMetrics();
@@ -157,7 +153,7 @@ protected void onCreate(Bundle savedInstanceState) {
157153
158154 if (touchList != null && touchList .isEmpty () == false ) { //TODO 回放操作
159155// recover(touchList);
160- startActivityForResult (UIAutoListActivity .createIntent (DemoApplication .getInstance (), touchList == null ? null : touchList .toJSONString ()), REQUEST_UI_AUTO_LIST );
156+ startActivity (UIAutoListActivity .createIntent (DemoApplication .getInstance (), touchList == null ? null : touchList .toJSONString ()));
161157// return;
162158 }
163159
@@ -364,11 +360,11 @@ public void onClick(View v) {
364360 }
365361
366362 public void toRemote (View v ) {
367- startActivityForResult (UIAutoListActivity .createIntent (context , false ), REQUEST_UI_AUTO_LIST );
363+ startActivity (UIAutoListActivity .createIntent (context , false ));
368364 }
369365
370366 public void toLocal (View v ) {
371- startActivityForResult (UIAutoListActivity .createIntent (context , true ), REQUEST_UI_AUTO_LIST );
367+ startActivity (UIAutoListActivity .createIntent (context , true ));
372368 }
373369
374370 public void record (View v ) {
@@ -379,7 +375,7 @@ public void record(View v) {
379375// finish();
380376
381377 DemoApplication .getInstance ().onUIAutoActivityCreate (this );
382- DemoApplication .getInstance ().record ( );
378+ DemoApplication .getInstance ().prepareRecord ( this );
383379 finish ();
384380 }
385381
@@ -806,35 +802,7 @@ public void record(View v) {
806802// return touchList;
807803// }
808804
809-
810-
811- public static final int REQUEST_UI_AUTO_LIST = 1 ;
812-
813- @ Override
814- protected void onActivityResult (int requestCode , int resultCode , Intent data ) {
815- super .onActivityResult (requestCode , resultCode , data );
816-
817- if (resultCode != RESULT_OK ) {
818- return ;
819- }
820-
821- if (requestCode == REQUEST_UI_AUTO_LIST ) {
822- JSONArray array = data == null ? null : JSON .parseArray (data .getStringExtra (UIAutoListActivity .RESULT_LIST ));
823- finish ();
824-
825- new Handler ().postDelayed (new Runnable () {
826- @ Override
827- public void run () {
828- touchList = new JSONArray ();
829- DemoApplication .getInstance ().recover (array );
830- }
831- }, 1000 );
832- }
833-
834- }
835-
836-
837- //
805+ //
838806// private static class Node<E> {
839807// E item;
840808// Node<E> next;
0 commit comments