public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); // this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, // WindowManager.LayoutParams.FLAG_FULLSCREEN); // // 隐去标题栏(程序的名字) this.requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.gupiao_layout); // listView = (ListView) findViewById(R.id.listview); // // adapter = new ListSharesAdapter(this, datas); // listView.setAdapter(adapter);,tv_1 tv_price = (TextView) findViewById(R.id.tv_price); tv_name = (TextView) findViewById(R.id.tv_name); tv_1 = (TextView) findViewById(R.id.tv_1); linear = (LinearLayout) findViewById(R.id.linear); drowLine = (DrowLine) findViewById(R.id.drowLine); drowFive = (DrowFive) findViewById(R.id.drowFive); // 绑定AIDL服务 Intent intent = new Intent(); intent.setClass(ShareActivity.this, CatchService.class); bindService(intent, serviceConnection, Context.BIND_AUTO_CREATE); startService(intent); bt_stop = (Button) findViewById(R.id.bt_stop); bt_stop.setOnClickListener(this); findViewById(R.id.bt_set).setOnClickListener(this); }
@Override protected void onResume() { super.onResume(); if (myService != null) { try { myService.getValue(isrun); } catch (RemoteException e) { e.printStackTrace(); } } }
@Override protected void onPause() { super.onPause(); // if (myService != null) { // try { // myService.getValue(false); // } catch (RemoteException e) { // e.printStackTrace(); // } // } }
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (data != null && resultCode == RESULT_OK) { try { if (myService != null) { String code = data.getStringExtra("code"); setVise(code); myService.answerRingingCall(code); isrun = true; bt_stop.setText("STOP"); myService.getValue(isrun); } } catch (RemoteException e) { e.printStackTrace(); } } super.onActivityResult(requestCode, resultCode, data); }
@Override protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); unbindService(serviceConnection); }