@Override protected void onStart() { super.onStart(); drone.events.addDroneListener(this); app.conectionListner = this; drone.MavClient.queryConnectionState(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_feedback); initView(); }
@Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.activity_setting); initViews(); }
@Override protected void onDestroy() { if (mTask != null) { mTask.mDialog.cancel(); if (mTask.getStatus() != AsyncTask.Status.FINISHED) mTask.cancel(true); // cancel AsyncTask } super.onDestroy(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.terminal); terminal = (TextView) findViewById(R.id.textViewTerminal); sendButton = (Button) findViewById(R.id.buttonSend); sendButton.setOnClickListener(this); }
/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mActionBarBackgroundDrawable = getResources().getDrawable(R.drawable.actionbarbackground); mActionBarBackgroundDrawable.setAlpha(0); getSupportActionBar().setBackgroundDrawable(mActionBarBackgroundDrawable); FragmentTransaction tx = getSupportFragmentManager().beginTransaction(); mMainMenuFragment = new MainMenuFragment(); tx.replace(R.id.fragment_categories, mMainMenuFragment); tx.commit(); }
@Override protected void onStart() { super.onStart(); Intent i = new Intent().setClass(this, FoodService.class); stopService(i); Intent intent = getIntent(); if (Intent.ACTION_VIEW.equals(intent.getAction())) { if (FoodProvider.buildUriMatcher().match(intent.getData()) == FoodProvider.CODE_FOOD) { Intent foodIntent = new Intent(Intent.ACTION_VIEW, intent.getData()); startActivity(foodIntent); } } else if (Intent.ACTION_SEARCH.equals(intent.getAction())) { final String term = intent.getStringExtra(SearchManager.QUERY); Intent si = new Intent(this, SearchResultActivity.class); si.putExtra(SearchManager.QUERY, term); startActivity(si); finish(); } GenericRateTheAppDialog rateAppDialog = GenericRateTheAppDialog.createInstance(); rateAppDialog.showMaybe(getSupportFragmentManager(), this); }
@Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.activity_info); if (!PreferencesActivity.getStringPreference(R.string.last_database_migration_key, null) .equals("")) ((TextView) findViewById(R.id.tv_local_database_version)) .setText( PreferencesActivity.getStringPreference(R.string.last_database_migration_key, null)); else ((TextView) findViewById(R.id.tv_local_database_version)).setText(R.string.info_no_database); if (!PreferencesActivity.getStringPreference(R.string.database_migration_duration_key, null) .equals("")) ((TextView) findViewById(R.id.tv_duration_last_update)) .setText( PreferencesActivity.getStringPreference( R.string.database_migration_duration_key, null) + " " + getText(R.string.time_entity)); else ((TextView) findViewById(R.id.tv_duration_last_update)).setText(R.string.info_no_database); }
@Override protected void onStop() { super.onStop(); drone.events.removeDroneListener(this); infoMenu = null; }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); screenOrientation.unlock(); gcsHeartbeat = new GCSHeartbeat(drone, 1); }
@Override protected void onResume() { super.onResume(); problemText.setText(""); }
/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Crashlytics.start(this); setContentView(R.layout.activity_signin); }
@Override public void onStart() { super.onStart(); }
@Override protected void onStop() { super.onDestroy(); MAVClient.onDestroy(); }
@Override protected void onResume() { super.onRestart(); MAVClient.init(); }
@Override protected void onStop() { super.onStop(); Intent i = new Intent().setClass(this, FoodService.class); startService(i); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.browse_info_webview); catInfoTitle = (TextView) this.findViewById(R.id.catInfoTitle); catInfoTitle.setText(getResources().getString(R.string.price)); webView = (WebView) this.findViewById(R.id.catInfoWebView); Intent intent = getIntent(); info = (Info) intent.getSerializableExtra("info"); location = intent.getIntExtra("location", 0); charset = intent.getStringExtra("charset"); String content = "<center><h3>" + info.getTitle() + "</h3>作者:" + info.getAuthor() + " 来源:" + info.getSource() + "</center>"; content += info.getContent(); CommonUtil.loadData(this, content, "text/html", charset, webView, true, true, false); nextInfoButton = (ImageButton) findViewById(R.id.nextInfoButton); CommonUtil.setButtonFocusChanged(nextInfoButton); nextInfoButton.setOnClickListener( new OnClickListener() { public void onClick(View v) { if (location + 1 > (AppCache.keyListMap.get(AppCache.PRICE).size() - 1)) { // 即下一篇资讯的位置 Toast.makeText(BrowsePriceActivity.this, "已经是最后一篇文章了", Toast.LENGTH_SHORT).show(); } else { new Thread() { public void run() { location += 1; HashMap<String, String> map = AppCache.keyListMap.get(AppCache.PRICE).get(location); int infoId = Integer.parseInt(map.get(PriceBuyActivity.URL_OR_INFOID)); Info info = InfoActivity.getInfoWithContentById(infoId, charset); if (null == info) return; String content = "<center><h3>" + info.getTitle() + "</h3>作者:" + info.getAuthor() + " 来源:" + info.getSource() + "</center>"; content += info.getContent(); CommonUtil.loadData( BrowsePriceActivity.this, content, "text/html", charset, webView, true, true, false); }; }.start(); } } }); }