@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.options); Button btnStart = (Button) findViewById(R.id.btnStart); btnStart.setOnClickListener( new View.OnClickListener() { public void onClick(View v) { RadioGroup rg = (RadioGroup) findViewById(R.id.radioGroupDificulty); int id = rg.getCheckedRadioButtonId(); View radioButton = rg.findViewById(id); int idx = rg.indexOfChild(radioButton); Intent intent = new Intent(getApplicationContext(), GoMap.class); intent.putExtra("Dificuldade", idx); intent.putExtra("Mode", 0); startActivity(intent); } }); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); System.setProperty("http.keepAlive", "false"); super.onCreate(savedInstanceState); setContentView(R.layout.activity_twitter_settings); }
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main_activity_for_wear); if (savedInstanceState == null) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main_activity_for_wear); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final Button runButton = new Button(this); runButton.setText("Run away!"); final RelativeLayout runLayout = (RelativeLayout) findViewById(R.id.runLayout); runLayout.addView(runButton); final RelativeLayout.LayoutParams buttonParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); runButton.setOnClickListener( new Button.OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub Random rand = new Random(); buttonParams.leftMargin = rand.nextInt(runLayout.getWidth() - 100); buttonParams.topMargin = rand.nextInt(runLayout.getHeight() - 100); runButton.setLayoutParams(buttonParams); } }); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); retrieveLocationButton = (Button) findViewById(R.id.retrieve_location_button); reverseGeocodingButton = (Button) findViewById(R.id.reverse_geocoding_button); locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); locationManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, MINIMUM_TIME_BETWEEN_UPDATES, MINIMUM_DISTANCE_CHANGE_FOR_UPDATES, new MyLocationListener()); retrieveLocationButton.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { showCurrentLocation(); } }); reverseGeocodingButton.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { performReverseGeocodingInBackground(); } }); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mDbHelper = new NotesDbAdapter(this); mDbHelper.open(); setContentView(R.layout.note_edit); setTitle(R.string.edit_note); mTitleText = (EditText) findViewById(R.id.title); mBodyText = (EditText) findViewById(R.id.body); Button confirmButton = (Button) findViewById(R.id.confirm); mRowId = (savedInstanceState == null) ? null : (Long) savedInstanceState.getSerializable(NotesDbAdapter.KEY_ROWID); if (mRowId == null) { Bundle extras = getIntent().getExtras(); mRowId = extras != null ? extras.getLong(NotesDbAdapter.KEY_ROWID) : null; } populateFields(); confirmButton.setOnClickListener( new View.OnClickListener() { public void onClick(View view) { setResult(RESULT_OK); finish(); } }); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); String[] paths = new String[] {DATA_PATH, DATA_PATH + "tessdata/"}; for (String path : paths) { File dir = new File(path); if (!dir.exists()) { if (!dir.mkdirs()) { Log.v(TAG, "ERROR: Creation of directory " + path + " on sdcard failed"); return; } else { Log.v(TAG, "Created directory " + path + " on sdcard"); } } } // lang.traineddata file with the app (in assets folder) // You can get them at: // http://code.google.com/p/tesseract-ocr/downloads/list // This area needs work and optimization if (!(new File(DATA_PATH + "tessdata/" + lang + ".traineddata")).exists()) { try { AssetManager assetManager = getAssets(); InputStream in = assetManager.open("tessdata/" + lang + ".traineddata"); // GZIPInputStream gin = new GZIPInputStream(in); OutputStream out = new FileOutputStream(DATA_PATH + "tessdata/" + lang + ".traineddata"); // Transfer bytes from in to out byte[] buf = new byte[1024]; int len; // while ((lenf = gin.read(buff)) > 0) { while ((len = in.read(buf)) > 0) { out.write(buf, 0, len); } in.close(); // gin.close(); out.close(); Log.v(TAG, "Copied " + lang + " traineddata"); } catch (IOException e) { Log.e(TAG, "Was unable to copy " + lang + " traineddata " + e.toString()); } } super.onCreate(savedInstanceState); setContentView(R.layout.activity_ocr); // _image = (ImageView) findViewById(R.id.image); _field = (EditText) findViewById(R.id.field); _button = (Button) findViewById(R.id.button); _button.setOnClickListener(new ButtonClickHandler()); _path = DATA_PATH + "/ocr.jpg"; }
@Override protected void onCreate(Bundle savedInstanceState) { // TODO 自動生成されたメソッド・スタブ super.onCreate(savedInstanceState); setContentView(R.layout.activity_list); // コンポーネントの関連付け layout = (RelativeLayout) this.findViewById(R.id.main_layout); listView = (ListView) this.findViewById(R.id.listView1); // リストビューのスクロールキャッシュ無効(色がおかしくなるので) listView.setScrollingCacheEnabled(false); // リスナーの設定 listView.setOnItemClickListener(this); // アダプター作成 adapter = new TaskArrayAdapter(this, setItem()); // リストビューに項目データ(アダプタ)をセット listView.setAdapter(adapter); // 何もタスクが無いのなら新規作成のダイアログが開く int i = 0; editText = new EditText(this); editText.setInputType(InputType.TYPE_CLASS_TEXT); for (int j = 0; j < 10; j++) { i += adapter.getList().get(j).getTask().length(); if (j == 9 && i == 0) { showYesDialog( ListActivity.this, "何かタスクを作ってみよう", "あなたがよく行う習慣を登録して時間を計りましょう", editText, this, 1); break; } } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.friendadd2); back18 = (ImageButton) findViewById(R.id.back18); back18.setScaleType(ImageView.ScaleType.FIT_XY); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.jincheon_webview); jincheon = (WebView) findViewById(R.id.jincheon_web); jincheon.setWebViewClient(new myWebClient()); jincheon_progress = (ProgressBar) findViewById(R.id.jincheon_pb); // Set Settings... Plugin ..etc // some warning is wrong, just go on away. jincheon.getSettings().setPluginsEnabled(true); jincheon.getSettings().setJavaScriptEnabled(true); jincheon.getSettings().setBuiltInZoomControls(true); jincheon.getSettings().setLoadWithOverviewMode(true); jincheon.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); jincheon.getSettings().setSupportMultipleWindows(true); jincheon.getSettings().setSupportZoom(true); jincheon.getSettings().setLoadsImagesAutomatically(true); jincheon.getSettings().setUseWideViewPort(true); jincheon.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); // Load Url if (savedInstanceState == null) { // 진천 카테고리 접속 jincheon.loadUrl("http://green-navi.tistory.com/m/post/list?categoryId=525722"); } }
/* (non-Javadoc) * @see android.app.Activity#onCreate(android.os.Bundle) */ @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.chronometerpage); Button button; mChronometer = (Chronometer) findViewById(R.id.chronometer); // Watch for button clicks. button = (Button) findViewById(R.id.start); button.setOnClickListener(mStartListener); button = (Button) findViewById(R.id.stop); button.setOnClickListener(mStopListener); button = (Button) findViewById(R.id.reset); button.setOnClickListener(mResetListener); button = (Button) findViewById(R.id.set_format); button.setOnClickListener(mSetFormatListener); button = (Button) findViewById(R.id.clear_format); button.setOnClickListener(mClearFormatListener); }
/** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); AdRequest ar = new AdRequest(); ar.addTestDevice("4B605421C6EAA120E18B7FA165D2E980"); final ListView lv1 = (ListView) findViewById(R.id.listView); threadArray = new ArrayList<String>(); authorArray = new ArrayList<String>(); getDevice(); lv1.setOnItemClickListener( new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> a, View v, int position, long id) { Object o = lv1.getItemAtPosition(position); TitleResults fullObject = (TitleResults) o; threadTitle = fullObject.getItemName(); Constants.THREADURL = threadArray.get(position); Intent intent = new Intent(MainActivity.this, ThreadActivity.class); Bundle b = new Bundle(); b.putString("title", threadTitle); intent.putExtras(b); startActivity(intent); } }); if (Constants.DEVICE != null) { ArrayList<TitleResults> titleArray = getTitles(); lv1.setAdapter(new TitleAdapter(this, titleArray)); } }
@Override protected void onCreate(Bundle savedInstanceState) { Intent intent = getIntent(); receivedVenue = (Venue) intent.getSerializableExtra("venue"); super.onCreate(savedInstanceState); setContentView(R.layout.activity_venue); fillInfo(receivedVenue); RetrieveEventsTask task = new RetrieveEventsTask(); task.execute(new String[] {(urlEvent)}); RetrieveVenueAverageTask task2 = new RetrieveVenueAverageTask(); task2.execute(new String[] {(urlRate)}); RetrieveReviewsTask task3 = new RetrieveReviewsTask(); task3.execute(new String[] {(urlGetReviews)}); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { // Show the Up button in the action bar. getActionBar().setDisplayHomeAsUpEnabled(true); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_daily_forecast); ButterKnife.bind(this); Intent intent = getIntent(); mLocation = intent.getStringExtra(getString(R.string.location_name)); Parcelable[] parcelables = intent.getParcelableArrayExtra(MainActivity.DAILY_FORECAST); mDays = Arrays.copyOf(parcelables, parcelables.length, Day[].class); mLocationLabel.setText(String.valueOf(mLocation)); DayAdapter adapter = new DayAdapter(this, mDays); mListView.setAdapter(adapter); mListView.setEmptyView(mEmptyTextView); mListView.setOnItemClickListener( new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { String dayOfTheWeek = mDays[position].getDayOfTheWeek(); String conditions = mDays[position].getSummary(); String highTemp = mDays[position].getTemperatureMax() + ""; String lowTemp = mDays[position].getTemperatureMin() + ""; String message = String.format( "%s - High: %s, Low: %s, and %s", dayOfTheWeek, highTemp, lowTemp, conditions); Toast.makeText(DailyForecastActivity.this, message, Toast.LENGTH_LONG).show(); } }); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); setupViews(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.test_activities); View firstButton = findViewById(R.id.first_btn); firstButton.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(TestActivities.this, TestActivityFirst.class); startActivity(intent); // transaction animation overridePendingTransition(R.anim.slide_in_bottom, R.anim.slide_out_bottom); } }); View secondButton = findViewById(R.id.second_btn); secondButton.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(TestActivities.this, TestActivitySecond.class); startActivity(intent); overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out); } }); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow() .setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE); setContentView(R.layout.activity_esp_5_03); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Creates the window used for the UI setContentView(R.layout.activity_stock_info); // Get the message from the intent that has the stock symbol Intent intent = getIntent(); String stockSymbol = intent.getStringExtra(MainActivity.STOCK_SYMBOL); // Initialize TextViews companyNameTextView = (TextView) findViewById(R.id.companyNameTextView); yearLowTextView = (TextView) findViewById(R.id.yearLowTextView); yearHighTextView = (TextView) findViewById(R.id.yearHighTextView); daysLowTextView = (TextView) findViewById(R.id.daysLowTextView); daysHighTextView = (TextView) findViewById(R.id.daysHighTextView); lastTradePriceOnlyTextView = (TextView) findViewById(R.id.lastTradePriceOnlyTextView); changeTextView = (TextView) findViewById(R.id.changeTextView); daysRangeTextView = (TextView) findViewById(R.id.daysRangeTextView); // Sends a message to the LogCat Log.d(TAG, "Before URL Creation " + stockSymbol); // Create the YQL query final String yqlURL = yahooURLFirst + stockSymbol + yahooURLSecond; // The Android UI toolkit is not thread safe and must always be // manipulated on the UI thread. This means if I want to perform // any network operations like grabbing xml data, I have to do it // in its own thread. The problem is that you can't write to the // GUI from outside the main activity. AsyncTask solves those problems new MyAsyncTask().execute(yqlURL); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // get instances to upload Intent i = getIntent(); ArrayList<String> instances = i.getStringArrayListExtra(GlobalConstants.KEY_INSTANCES); if (instances == null) { // nothing to upload return; } SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getBaseContext()); String url = settings.getString(UserPreferences.KEY_SERVER, getString(R.string.default_server)); String authCredentials = settings.getString(UserPreferences.KEY_USERNAME, getString(R.string.username)) + ":" + settings.getString(UserPreferences.KEY_PASSWORD, getString(R.string.password)); mInstanceUploaderTask = (InstanceUploaderTask) getLastNonConfigurationInstance(); if (mInstanceUploaderTask == null) { // setup dialog and upload task showDialog(PROGRESS_DIALOG); mInstanceUploaderTask = new InstanceUploaderTask(); mInstanceUploaderTask.setUploadServer(url + "/fileUpload?"); mInstanceUploaderTask.setAuthCredentials(authCredentials); totalCount = instances.size(); // convert array list to an array String[] sa = instances.toArray(new String[totalCount]); mInstanceUploaderTask.execute(sa); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); // 保持屏幕亮 // getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, // WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_main); webview = (WebView) super.findViewById(R.id.webView); progress = (ProgressBar) super.findViewById(R.id.progress); // progress.setVisibility(View.GONE); webview.setWebChromeClient(new WebChromeClientImpl(handler)); webview.setWebViewClient(wc); // webview.setInitialScale(25); ws = webview.getSettings(); ws.setJavaScriptCanOpenWindowsAutomatically(true); ws.setJavaScriptEnabled(true); ws.setPluginState(PluginState.ON); ws.setDefaultZoom(WebSettings.ZoomDensity.MEDIUM); Log.i("---", "加载"); // ws.setSupportZoom(true); // ws.setBuiltInZoomControls(true);//设置支持缩放 // ws.setUseWideViewPort(true); webview.loadUrl("http://aaaadc.com"); // webview.loadUrl("http://www.oceanthree.hk/apps_shop/app_index.php"); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); initializeList(); inDrawerLayout(); btnsearch = (Button) findViewById(R.id.btn_main_search); btnproduct = (Button) findViewById(R.id.btn_product); btnstory = (Button) findViewById(R.id.btn_story); btnintroduce = (Button) findViewById(R.id.btn_introduce); btnsearch.setOnClickListener(this); btnproduct.setOnClickListener(this); btnstory.setOnClickListener(this); btnintroduce.setOnClickListener(this); btnaccount = (Button) findViewById(R.id.btn_drawer); btnaccount.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { switch (v.getId()) { case R.id.btn_drawer: drawer.openDrawer(drawerList); break; default: break; } } }); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); overridePendingTransition(R.anim.pull_in_from_left, R.anim.pull_out_to_left); setContentView(R.layout.pass); close = (Button) findViewById(R.id.pass_cl); login = (Button) findViewById(R.id.pass_yes); forget = (Button) findViewById(R.id.pass_no); uName = (EditText) findViewById(R.id.pass_username); pass = (EditText) findViewById(R.id.pass_pwd); tView = (TextView) findViewById(R.id.pass_title); close.setOnClickListener(this); login.setOnClickListener(this); forget.setOnClickListener(this); db.open(); Cursor mCursor = db.getAllRecords(); mCursor.moveToFirst(); rName = mCursor.getString(1); if (mCursor.getCount() > 0) { uName.setClickable(false); uName.setBackgroundResource(R.drawable.keypad1); } db.close(); tView.setText(rName + " @ MoneyMan"); uName.setText(rName); } // end onCreate()
/** * Initiate the Caster Activity, load the sounds up, set up touch listener, vibrator, sensor * manager, and accelerometer sensor * * @param savedInstanceState */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.requestWindowFeature(Window.FEATURE_NO_TITLE); this.getWindow() .setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setContentView(R.layout.caster); castDistance = 0; casterBackground = (ImageView) findViewById(R.id.caster_background); casterBackground.setOnTouchListener(this); audioTask = new AudioTask(); soundManager = SoundManager.getInstance(); // TODO: background animation once we get the assets. vibrotron = (Vibrator) getApplicationContext().getSystemService(Context.VIBRATOR_SERVICE); sensorManager = (SensorManager) getApplicationContext().getSystemService(Context.SENSOR_SERVICE); accelerometer = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ActionBar ab = getActionBar(); ab.setDisplayUseLogoEnabled(true); ab.setDisplayShowTitleEnabled(false); setContentView(R.layout.activity_main); table = Table.getInstance(this); List<User> users = (List<User>) table.users.select("usr_logged_in='1'"); if (users.isEmpty()) { Intent intent = new Intent(this, AccountManagement.class); startActivity(intent); } user = users.get(0); tasks = table.tasks.select("task_username='******'"); listView = (ListView) findViewById(R.id.list_view_tasks); taskArrayAdapter = new TaskArrayAdapter(this, R.layout.task, tasks); // listView.setClickable(true); // listView.setItemsCanFocus(true); // listView.setOnItemClickListener(clickOnTask); // listTasks.setOnItemLongClickListener(editOnTask); listView.setAdapter(taskArrayAdapter); taskArrayAdapter.notifyDataSetChanged(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.slide_four_sf_03); // 初始化控件 initView(); }
@Override protected void onCreate(Bundle savedInstanceState) { _newsTopics.clear(); super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); }
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.servos); PreferenceManager.setDefaultValues((Context) this, (int) R.xml.preferences, (boolean) false); this.a = new Utility((Activity) this); RobotLog.writeLogcatToDisk((Context) this, (int) 1024); this.d = (EditText) this.findViewById(R.id.servocontroller_name); LinearLayout linearLayout = (LinearLayout) this.findViewById(R.id.linearLayout_servo1); this.e = this.getLayoutInflater().inflate(R.layout.servo, (ViewGroup) linearLayout, true); TextView textView = (TextView) this.e.findViewById(R.id.port_number_servo); textView.setText((CharSequence) "1"); LinearLayout linearLayout2 = (LinearLayout) this.findViewById(R.id.linearLayout_servo2); this.f = this.getLayoutInflater().inflate(R.layout.servo, (ViewGroup) linearLayout2, true); TextView textView2 = (TextView) this.f.findViewById(R.id.port_number_servo); textView2.setText((CharSequence) "2"); LinearLayout linearLayout3 = (LinearLayout) this.findViewById(R.id.linearLayout_servo3); this.g = this.getLayoutInflater().inflate(R.layout.servo, (ViewGroup) linearLayout3, true); TextView textView3 = (TextView) this.g.findViewById(R.id.port_number_servo); textView3.setText((CharSequence) "3"); LinearLayout linearLayout4 = (LinearLayout) this.findViewById(R.id.linearLayout_servo4); this.h = this.getLayoutInflater().inflate(R.layout.servo, (ViewGroup) linearLayout4, true); TextView textView4 = (TextView) this.h.findViewById(R.id.port_number_servo); textView4.setText((CharSequence) "4"); LinearLayout linearLayout5 = (LinearLayout) this.findViewById(R.id.linearLayout_servo5); this.i = this.getLayoutInflater().inflate(R.layout.servo, (ViewGroup) linearLayout5, true); TextView textView5 = (TextView) this.i.findViewById(R.id.port_number_servo); textView5.setText((CharSequence) "5"); LinearLayout linearLayout6 = (LinearLayout) this.findViewById(R.id.linearLayout_servo6); this.j = this.getLayoutInflater().inflate(R.layout.servo, (ViewGroup) linearLayout6, true); TextView textView6 = (TextView) this.j.findViewById(R.id.port_number_servo); textView6.setText((CharSequence) "6"); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.edit_post_layout); WindowManager mWm = (WindowManager) getSystemService(Context.WINDOW_SERVICE); mWm.getDefaultDisplay().getMetrics(dm); /*TextView textview_city = (TextView)findViewById(R.id.textcity_item); LayoutParams laParams0 = (LayoutParams)textview_city.getLayoutParams(); laParams0.height=dm.heightPixels - dm.widthPixels; laParams0.width = dm.widthPixels; textview_city.setPadding(0, 0, 100, 200);*/ // textview_city.setLayoutParams(laParams0); // ����mContext mPoscalCodList = new ArrayList<String>(); // ��ȡ��� readPostalCodeList(); mCheckArray = new boolean[mPoscalCodList.size()]; for (int i = 0; i < mCheckArray.length; i++) { mCheckArray[i] = false; } mgridview = (GridView) findViewById(R.id.grid_citys); mgridview.requestFocus(); mcitysAdapter = new citysAdapter(this); mgridview.setAdapter(mcitysAdapter); WeatherReceiver.setEditHandler(mHandler); }
@Override protected void onCreate(Bundle savedInstanceState) { int skin = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getInt("shinId", 0); if (skin != 0) { // 两个参数:1、插件id,插件主题id String pluginId = "com.example.plugintest"; // 这里修改主题是会修改当前Activiy的Context // 所以在当前页面获取getDefaultSharedPreferences是不能使用this,要使用getApplicationContext // 否则在修改了Context后, 再次获取的getDefaultSharedPreferences和修改之前获取的不是同一个对象 PluginThemeHelper.applyPluginTheme(this, pluginId, skin); } super.onCreate(savedInstanceState); setContentView(R.layout.main_activity); setTitle("插件列表"); // 监听插件安装 安装新插件后刷新当前页面 registerReceiver(pluginChange, new IntentFilter("com.plugin.core.action_plugin_changed")); initView(); listAll(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Log.v(TAG, "onCreate called"); txtfirtsname = (EditText) findViewById(R.id.editText_fname); txtlastname = (EditText) findViewById(R.id.editText_lname); txtaddress = (EditText) findViewById(R.id.editText_address); txtemail = (EditText) findViewById(R.id.editText_email); txtto = (EditText) findViewById(R.id.editText_to); txtsubj = (EditText) findViewById(R.id.editText_subj); txttextmsg = (EditText) findViewById(R.id.editText_text); btnexport = (Button) findViewById(R.id.button_export); btnexport.setOnClickListener(this); btninsertdata = (Button) findViewById(R.id.button_Insert); btninsertdata.setOnClickListener(this); btnsendmail = (Button) findViewById(R.id.button_sendmail); btnsendmail.setOnClickListener(this); btnimport = (Button) findViewById(R.id.button_import); btnimport.setOnClickListener(this); dbhelper = new DatabaseHelper(getApplicationContext()); }