@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.line_list); // Setup the list adapter = new IconAdapter<FileWrapper>(this, R.layout.line_list_item); ListView list = (ListView) findViewById(R.id.list); list.setAdapter(adapter); list.setOnItemClickListener(this); // Load Directory if (savedInstanceState != null) { backStack = savedInstanceState.getParcelableArrayList("BACKSTACK"); } if (backStack == null || backStack.size() == 0) { backStack = new ArrayList<BackStackItem>(); String startPath = (startDirectory == null || startDirectory.isEmpty()) ? Environment.getExternalStorageDirectory().getPath() : startDirectory; backStack.add(new BackStackItem(startPath, false)); } wrapFiles(); this.setVolumeControlStream(AudioManager.STREAM_MUSIC); }
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); textView = new TextView(this); textView.setText("Toca y arrastra (solo un dedo)"); textView.setOnTouchListener(this); setContentView(textView); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.requestWindowFeature(Window.FEATURE_NO_TITLE); // // this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.main_login); mEtAccount = (EditText) findViewById(R.id.mainLoginEditAccount); mEtPassword = (EditText) findViewById(R.id.mainLoginEditPassword); mBtnLogin = (Button) findViewById(R.id.mainLoginBtn); mBtnRegister = (Button) findViewById(R.id.main_btn_register); /* this is to render the password edittext font to be default */ mEtPassword.setTypeface(Typeface.DEFAULT); mEtPassword.setTransformationMethod(new PasswordTransformationMethod()); mBtnLogin.setOnClickListener( new OnClickListener() { public void onClick(View v) { MainActivity.this.tryLogin(); } }); mBtnRegister.setOnClickListener( new OnClickListener() { public void onClick(View v) { Intent intent0 = new Intent(MainActivity.this, RegisterActivity.class); startActivity(intent0); } }); }
/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Create a SQLite database holding event info DatabaseOpener dbopenhelper = new DatabaseOpener(this); db = dbopenhelper.getWritableDatabase(); setContentView(R.layout.event_list); this.lv = (ListView) findViewById(R.id.eventListView); // Subclass CursorAdapter to read data from the database into the // ListView Cursor c = db.query( "event", new String[] {"_id", "isfavorite", "name", "starttime", "endtime"}, null, null, null, null, "starttime asc"); dbadapter = new EventListCursorAdapter(this, c, false); lv.setAdapter(dbadapter); }
@Override protected void onDestroy() { super.onDestroy(); // 종료시 타이머 멈춤 cTimer.cancel(); }
/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) { // We can read and write the media try { url = (String) getIntent().getExtras().get(Intent.EXTRA_TEXT) + "#view:list"; } catch (Exception e) { url = "https://www.dropbox.com/s/8owsfcia59ko76i#view:list"; // Used for testing if it's not opened from the dropox action menu // Obviously what needs to happen here is a message suggesting that the user use the dropbox // app, and a textbox in case they've got the url copied. } showDialog( PROGRESS_DIALOG); // Do the work in a separate thread so we can update the UI // simultaneously. } else { // Can't write files, so show a message and quit. } }
/** Called when the activity is first created */ @Override public void onCreate(Bundle savedInstanceState) { Log.d(TAG, "LoaderActivity created"); super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.content); // Instantiate custom adapter mAdapter = new LoaderAdapter(); // Handle listview and assign adapter mListView = (ListView) findViewById(R.id.content_list_view); mListView.setAdapter(mAdapter); mListView.setVisibility(View.GONE); mListView.setOnItemLongClickListener( new AdapterView.OnItemLongClickListener() { public boolean onItemLongClick(AdapterView parent, View view, int position, long id) { selectItem(position); return true; } }); mStatusLabel = (TextView) findViewById(R.id.content_status_label); mStatusLabel.setVisibility(View.VISIBLE); String userHash = NavigineApp.Settings.getString("user_hash", ""); if (userHash.length() == 0) showUserHashDialog(); else refreshMapList(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // remove title requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow() .setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_main_game); allDoneLevels = new ArrayList<>(); AssetManager am = getResources().getAssets(); final GameBoard boardView = (GameBoard) this.findViewById(R.id.gameBoard); final HowdyShadeView howdyShadeView = (HowdyShadeView) this.findViewById(R.id.howdyShadeView); final GlowingBoard glowingBoard = (GlowingBoard) this.findViewById(R.id.glowingBoard); final HowdyView howdyView = (HowdyView) this.findViewById(R.id.howdyView); this.game = new Game(); boardView.setHowdyShadeView(howdyShadeView); boardView.setGlowingBoard(glowingBoard); boardView.setHowdyView(howdyView); boardView.setOnTouchListener(new BoardGameTouchListener(this)); }
@Override protected void onStart() { final GameBoard boardView = (GameBoard) this.findViewById(R.id.gameBoard); SharedPreferences prefs = getPreferences(Context.MODE_PRIVATE); this.level = prefs.getInt("level", 0); String mapJson = prefs.getString("map", null); if (mapJson == null) { waitForNext = true; } else { this.game.initGame(mapJson); String howdyPosition = prefs.getString("howdy", null); if (howdyPosition != null) { this.game.setHowdyPosition(howdyPosition); } Toast.makeText(this, this.level + "", Toast.LENGTH_SHORT).show(); } String allDoneLevelsString = prefs.getString("doneLevels", null); if (allDoneLevelsString != null) { allDoneLevels = new ArrayList<String>(Arrays.asList(allDoneLevelsString.split(","))); } super.onStart(); }
// pressing back button finishes this activity public void onBackPressed() { // writeProgress(completed_downloads,total_files_to_download); downloadThread.requestStop(); super.onBackPressed(); // download_photos.this.finish(); }
@Override public void onPause() { Log.d(TAG, "LoaderActivity paused"); super.onPause(); mTimerTask.cancel(); mTimerTask = null; }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.detailedtask); service = AndroidCMWebService.service().userWebService(); task = getIntent().getParcelableExtra(TaskAdapter.TASK_KEY); fillInTaskInformation(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.xiph_copyright); TextView tv = (TextView) findViewById(R.id.text); tv.setText(getXiphCopyright()); tv.setMovementMethod(new ScrollingMovementMethod()); }
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.data_callwordcp); mText = (EditText) findViewById(R.id.edittext); findViewById(R.id.readall).setOnClickListener(mClickListener); findViewById(R.id.readone).setOnClickListener(mClickListener); findViewById(R.id.insert).setOnClickListener(mClickListener); findViewById(R.id.delete).setOnClickListener(mClickListener); findViewById(R.id.update).setOnClickListener(mClickListener); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.settings); this.setTitle(R.string.setting); sp = PreferenceManager.getDefaultSharedPreferences(this); edit = sp.edit(); Button widgettheme = (Button) findViewById(R.id.widgettheme); Button settime = (Button) findViewById(R.id.settime); Button save = (Button) findViewById(R.id.set_save); nc = (CheckBox) findViewById(R.id.nightcheck); rs = (CheckBox) findViewById(R.id.ringswitch); widgettheme.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View Button) { AlertDialog.Builder ad = new AlertDialog.Builder(Settings.this) .setTitle("选择颜色?") .setItems( color, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface p1, int p2) { edit.putInt("widgetTextColor", colori[p2]); edit.commit(); } }); ad.show(); } }); settime.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View Button) { Intent set = new Intent(Settings.this, Settime.class); startActivity(set); return; } }); save.setOnClickListener( new View.OnClickListener() { public void onClick(View Button) { save(); return; } }); nc.setChecked(sp.getBoolean("nightmode", false)); if (sp.getBoolean("timewrong", false) == true) { rs.setChecked(false); rs.setClickable(false); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); sdk = android.os.Build.VERSION.SDK_INT; player = 1; tv = (TextView) findViewById(R.id.mainTextView); tv1 = (TextView) findViewById(R.id.mainTextViewVencedor); tv.setText("Jogador 1"); }
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.input_contextmenu); mBtn = (Button) findViewById(R.id.button); registerForContextMenu(mBtn); mEdit = (EditText) findViewById(R.id.edittext); registerForContextMenu(mEdit); mImage = (MyImage) findViewById(R.id.myimage); registerForContextMenu(mImage); }
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.c09_overscroll); for (int i = 1001; i <= 1003; i++) { mItem.add(Integer.toString(i)); } mAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mItem); mList = (ListView) findViewById(R.id.list); mList.setAdapter(mAdapter); }
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.codelayout); LinearLayout MyLinear = (LinearLayout) findViewById(R.id.mylinear); MyLinear.setOrientation(LinearLayout.HORIZONTAL); Button MyBtn = (Button) findViewById(R.id.mybutton); MyBtn.setTextSize(40); EditText MyEdit = (EditText) findViewById(R.id.myedit); MyEdit.setBackgroundColor(0xff00ff00); }
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.c19_sdcard); mEdit = (EditText) findViewById(R.id.edittext); String ext = Environment.getExternalStorageState(); if (ext.equals(Environment.MEDIA_MOUNTED)) { mSdPath = Environment.getExternalStorageDirectory().getAbsolutePath(); } else { mSdPath = Environment.MEDIA_UNMOUNTED; } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.ac_loading); getWindow().setFormat(PixelFormat.RGBA_8888); mPref = new Manage_Camera_SharedPreference(AC_Loading.this); loadingIconLayout = (ImageView) findViewById(R.id.loadingIcon); cTimer.start(); }
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.addprescription); add = (Button) findViewById(R.id.pAdd); timeTTWidget = (TimePicker) findViewById(R.id.timePicker); mLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); Criteria criteria = new Criteria(); provider = mLocationManager.getBestProvider(criteria, false); Location location = mLocationManager.getLastKnownLocation(provider); latitude = location.getLatitude(); longitude = location.getLongitude(); add.setOnClickListener( new View.OnClickListener() { public void onClick(View view) { name = (EditText) findViewById(R.id.pName); hour = timeTTWidget .getCurrentHour(); // returns int from 0-23 (24 hour clock), no need to worry // about am or pm minute = timeTTWidget.getCurrentMinute(); reason = (EditText) findViewById(R.id.pFor); boolean[] daysOfWeekToTake = { ((CheckBox) findViewById(R.id.sunday)).isChecked(), ((CheckBox) findViewById(R.id.monday)).isChecked(), ((CheckBox) findViewById(R.id.tuesday)).isChecked(), ((CheckBox) findViewById(R.id.wednesday)).isChecked(), ((CheckBox) findViewById(R.id.thursday)).isChecked(), ((CheckBox) findViewById(R.id.friday)).isChecked(), ((CheckBox) findViewById(R.id.saturday)).isChecked(), }; prescription_name = name.getText().toString(); prescription_sickness = reason.getText().toString(); EditText notesWidget = (EditText) findViewById(R.id.notes); String notes = notesWidget.getText().toString(); String daysString = booleanArrToStr( daysOfWeekToTake); // For some reason, cant store a boolean[] in a ParseObject, // so I created a method to convert boolean[] to a string of // 0s and 1s parsePrescription( daysString, prescription_name, prescription_sickness, notes, hour, minute); parseOutbreak(prescription_sickness, latitude, longitude); finish(); } }); }
/** * Checks if there is a call in progress. If true then shows a warning toast and finishes the * activity. * * @param activity activity doing a check. * @return <tt>true</tt> if there is call in progress and <tt>Activity</tt> was finished. */ public static boolean checkCallInProgress(Activity activity) { if (CallManager.getActiveCallsCount() > 0) { logger.warn("Call is in progress"); Toast t = Toast.makeText(activity, R.string.service_gui_WARN_CALL_IN_PROGRESS, Toast.LENGTH_SHORT); t.show(); activity.finish(); return true; } else { return false; } }
@Override public void onWindowFocusChanged(boolean hasFocus) { // TODO: Implement this method super.onWindowFocusChanged(hasFocus); if (waitForNext) { this.nextLevel(); waitForNext = false; } ((GameBoard) findViewById(R.id.gameBoard)).setGame(this.game); findViewById(R.id.gameBoard).invalidate(); ((GameBoard) findViewById(R.id.gameBoard)).getHowdyShadeView().invalidate(); }
@Override public void onResume() { Log.d(TAG, "LoaderActivity resumed"); super.onResume(); // Starting interface updates mTimerTask = new TimerTask() { @Override public void run() { mHandler.post(mRunnable); } }; mTimer.schedule(mTimerTask, 100, 100); }
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); if (v == mBtn) { menu.setHeaderTitle("Button Menu"); menu.add(0, 1, 0, "Red"); menu.add(0, 2, 0, "Green"); menu.add(0, 3, 0, "Blue"); } if (v == mEdit) { menu.add(0, 4, 0, "번역하기"); menu.add(0, 5, 0, "필기 인식"); } }
@Override public void onResume() { Log.i(LOG_FILE_NAME, "resume"); if (checkLaunchState(LaunchState.GeckoRunning)) GeckoAppShell.onResume(); // After an onPause, the activity is back in the foreground. // Undo whatever we did in onPause. super.onResume(); // Just in case. Normally we start in onNewIntent if (checkLaunchState(LaunchState.PreLaunch) || checkLaunchState(LaunchState.Launching)) onNewIntent(getIntent()); registerReceiver(mConnectivityReceiver, mConnectivityFilter); GeckoNetworkManager.getInstance().start(); GeckoScreenOrientationListener.getInstance().start(); }
protected void onPrepareDialog(int id, Dialog dialog) { super.onPrepareDialog(id, dialog); switch (id) { case SampleDialog: break; case QuestionDialog: Calendar calendar = Calendar.getInstance(); String stime = String.format( "%d시 %d분 %d초", calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE), calendar.get(Calendar.SECOND)); dialog.setTitle(stime); break; } }
@Override public void onCreate(Bundle savedInstanceState) { Log.d(TAG, "onCreate"); super.onCreate(savedInstanceState); Thread.currentThread().setUncaughtExceptionHandler(this); setContentView(R.layout.main); inputView = (EditText) findViewById(R.id.input_view); inputView.setOnEditorActionListener(this); listAdapter = new ArrayAdapter<String>(this, R.layout.row); listAdapter.setNotifyOnChange(true); resultsView = (ListView) this.findViewById(R.id.results_view); resultsView.setAdapter(listAdapter); resultsView.setOnItemClickListener(this); }
@Override public void onCreate(Bundle savedInstanceState) { c = this; preferences = PreferenceManager.getDefaultSharedPreferences(c); super.onCreate(savedInstanceState); setContentView(R.layout.gpu_sgx540); gpuCurrent = readFile(Constants.GPU_SGX540); seekGpu = (SeekBar) findViewById(R.id.seek_gpu); gpu = Arrays.asList(153, 307, 384); seekBar(gpu.size() - 1, gpu.indexOf(gpuCurrent)); /*else{ seekGpu.setEnabled(false); seekIva.setEnabled(false); TextView ns = (TextView)findViewById(R.id.not_supported); ns.setVisibility(View.VISIBLE); }*/ preferences = PreferenceManager.getDefaultSharedPreferences(getBaseContext()); curGpuTxt = (TextView) findViewById(R.id.current_gpu); maxGpuTxt = (TextView) findViewById(R.id.max_gpu); minGpuTxt = (TextView) findViewById(R.id.min_gpu); mhz = getResources().getString(R.string.mhz); current = getResources().getString(R.string.current); max = getResources().getString(R.string._max); min = getResources().getString(R.string._min); curGpuTxt.setText(current + ": " + (gpuCurrent) + mhz); maxGpuTxt.setText(max + ": " + gpu.get(2) + mhz); minGpuTxt.setText(min + ": " + gpu.get(0) + mhz); Button cancel = (Button) findViewById(R.id.cancel); cancel.setOnClickListener( new OnClickListener() { @Override public void onClick(View arg0) { finish(); } }); }