private void initComponents() { remove = getIntent().getIntegerArrayListExtra("remove"); pre = (Button) findViewById(R.id.pre); next = (Button) findViewById(R.id.next); refresh = (Button) findViewById(R.id.refresh); add2Fav = (Button) findViewById(R.id.add2_fav); postNewArticle = (Button) findViewById(R.id.post_article); pre.setOnClickListener(this); next.setOnClickListener(this); refresh.setOnClickListener(this); add2Fav.setOnClickListener(this); postNewArticle.setOnClickListener(this); if (remove.contains(Constants.NEXT)) { next.setVisibility(View.GONE); } if (remove.contains(Constants.PRE)) { pre.setVisibility(View.GONE); } if (remove.contains(Constants.REFRESH)) { refresh.setVisibility(View.GONE); } if (remove.contains(Constants.ADD_2_FAV)) { add2Fav.setVisibility(View.GONE); } if (remove.contains(Constants.POST_ARTICLE)) { postNewArticle.setVisibility(View.GONE); } }
private void stopRecording(boolean isComingFromViewClick) { if (countDownTimer != null) { countDownTimer.cancel(); } // //// ****** Handles UI items on button click ****** /////// editStopButton.setVisibility(View.GONE); editPlayButton.setVisibility(View.VISIBLE); editRerecordButton.setVisibility(View.VISIBLE); // //// ******* Stop Recording Audio and stop chronometer ******** //////// if (mRecordingHelper != null && mRecordingHelper.isRecording()) { mRecordingHelper.stopRecording(); } editTimeDetailsChronometer.stop(); if (mAudioPlay != null && mAudioPlay.isAudioPlaying()) { mAudioPlay.stopPlayBack(); } if (isFromFavorite) { mAudioPlay = new AudioPlay(mFavoriteList.id, this, isFromFavorite); } else { mAudioPlay = new AudioPlay(entry.id, this, isFromFavorite); } String displayTime = new DisplayTimeForChronometer().getDisplayTime(mAudioPlay.getPlayBackTime()); editTimeDetailsChronometer.setText(displayTime); Map<String, String> map = new HashMap<String, String>(); map.put("Display Time ", displayTime); FlurryAgent.onEvent(getString(R.string.audio_recording_time), map); }
private void setVisibility(int visibility) { if (visibility == CONNECT_VIEW) { rootview.setVisibility(View.GONE); connect_button_view.setVisibility(View.VISIBLE); textViewShowTime.setVisibility(View.GONE); } else if (visibility == TREATMENT_SERVICE_NOT_FOUND) { rootview.setVisibility(View.VISIBLE); connect_button_view.setVisibility(View.GONE); buttonStartTime.setVisibility(View.GONE); textViewShowTime.setVisibility(View.GONE); mProgressBar.setVisibility(View.GONE); delayCheckBox.setVisibility(View.GONE); // create progressdialog while connecting to the services progressDialog = new ProgressDialog(this); // show message progressDialog.setMessage("Connecting to the services"); progressDialog.show(); } else if (visibility == TREATMENT_SERVICE_FOUND) { rootview.setVisibility(View.VISIBLE); connect_button_view.setVisibility(View.GONE); buttonStartTime.setVisibility(View.VISIBLE); mProgressBar.setVisibility(View.VISIBLE); delayCheckBox.setVisibility(View.VISIBLE); // dismiss the progressdialog progressDialog.dismiss(); } }
/** * 发起路线规划搜索示例 * * @param v */ void SearchButtonProcess(View v) { // 重置浏览节点的路线数据 route = null; routeOverlay = null; transitOverlay = null; mBtnPre.setVisibility(View.INVISIBLE); mBtnNext.setVisibility(View.INVISIBLE); // 对起点终点的name进行赋值,也可以直接对坐标赋值,赋值坐标则将根据坐标进行搜索 MKPlanNode stNode = new MKPlanNode(); stNode.name = editSt.getText().toString(); if (ptStart != null) { stNode.pt = ptStart; } MKPlanNode enNode = new MKPlanNode(); enNode.name = editEn.getText().toString(); if (ptEnd != null) { enNode.pt = ptEnd; } pb.show(); // 实际使用中请对起点终点城市进行正确的设定 if (mBtnDrive.equals(v)) { mSearch.drivingSearch("上海", stNode, "上海", enNode); } else if (mBtnTransit.equals(v)) { mSearch.transitSearch("上海", stNode, enNode); } else if (mBtnWalk.equals(v)) { mSearch.walkingSearch("上海", stNode, "上海", enNode); } ptEnd = null; ptStart = null; }
@Override public void onClick(View view) { switch (view.getId()) { case R.id.login_number: iv_code.setVisibility(View.GONE); iv_password.setImageResource(R.drawable.icon_pwd); login_number.setBackgroundResource(R.drawable.background_view_green_left); login_Code.setBackgroundColor(getResources().getColor(R.color.transparent)); login_number.setTextColor(getResources().getColor(R.color.white)); login_Code.setTextColor(getResources().getColor(R.color.black)); type = "number"; break; case R.id.login_Code: iv_code.setVisibility(View.VISIBLE); iv_password.setImageResource(R.drawable.icon_code); login_Code.setBackgroundResource(R.drawable.background_view_green_right); login_number.setBackgroundColor(getResources().getColor(R.color.transparent)); login_number.setTextColor(getResources().getColor(R.color.black)); login_Code.setTextColor(getResources().getColor(R.color.white)); passwordEditText.setHint("验证码为4位数字"); type = "code"; break; case R.id.iv_code: currentUsername = usernameEditText.getText().toString().trim(); Log.e("username", currentUsername); if (!currentUsername.equals("") && currentUsername != null) { registercode(currentUsername); } else { Toast.makeText(context, "请输入手机号码", Toast.LENGTH_SHORT).show(); } break; } }
@Override public void sendQqEntity(QqLoginEntity entity, int channel) { // TODO Auto-generated method stub super.sendQqEntity(entity, channel); findViewById(R.id.layout_qq_login).setEnabled(false); findViewById(R.id.layout_phone).setEnabled(false); bindPhone.setVisibility(View.GONE); bindQQ.setVisibility(View.GONE); if (mToken == null) { if (channel == 1) { phoneNum.setText(getString(R.string.login_loading)); phoneBar.setVisibility(View.VISIBLE); } else if (channel == 2) { qqBar.setVisibility(View.VISIBLE); qqName.setText(getString(R.string.login_loading)); findViewById(R.id.qq_arrow).setVisibility(View.GONE); } } else { if (channel == 1) { phoneBar.setVisibility(View.VISIBLE); phoneNum.setText(getString(R.string.bind_loading)); } else if (channel == 2) { qqBar.setVisibility(View.VISIBLE); qqName.setText(getString(R.string.bind_loading)); } } }
private static void showTip( Activity activity, String tip, View.OnClickListener secondButtonListener, String secondButtonTitle) { tipTextView.setText(tip); final Crouton crouton = Crouton.make(activity, tipView); crouton.setConfiguration(CONFIGURATION_INFINITE); crouton.show(); tipButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { crouton.hide(); } }); if (secondButtonListener != null) { tipAlternativeButton.setVisibility(View.VISIBLE); tipAlternativeButton.setOnClickListener(secondButtonListener); tipAlternativeButton.setText(secondButtonTitle); tipAlternativeButton.setOnTouchListener( new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { crouton.hide(); return false; } }); } else { tipAlternativeButton.setVisibility(View.GONE); } }
// прячу НАДЕТЬ и ВЫБРОСИТЬ и показываю СНЯТЬ static void DisEn1() { btnThrow.setVisibility(View.GONE); btnWear.setVisibility(View.GONE); btnShoot.setVisibility(View.GONE); if (Integer.parseInt(shoot) != 0) btnShoot.setVisibility(View.VISIBLE); // если в ячейке нет предмета }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Don't show the Action Bar on the start screen getActionBar().hide(); setFonts(); buttonStart = (Button) findViewById(R.id.button_play); buttonStart.setVisibility(View.INVISIBLE); buttonFbLogin = (Button) findViewById(R.id.facebook); buttonFbLogin.setVisibility(View.INVISIBLE); ParseUser currentUser = ParseUser.getCurrentUser(); if (currentUser != null) { System.out.println("doctor please"); System.out.println(currentUser.getEmail()); System.out.println(currentUser.getUsername()); } progressBar = (ProgressBar) findViewById(R.id.progress_bar); progressBar.setVisibility(View.VISIBLE); new GetIdsAsync().execute(""); }
/** * 设置右侧按钮可见,及事件 * * @param onClickListener * @param title */ protected void setRightVisible(OnClickListener onClickListener, String title) { if (getActivity() == null) { return; } Button back = (Button) getActivity().findViewById(R.id.title_back_btn); if (back == null) { return; } Button right = (Button) getActivity().findViewById(R.id.title_right_btn); right.setVisibility(View.VISIBLE); if (title != null && !title.equals("")) { right.setText(title); } back.setVisibility(View.VISIBLE); back.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub getActivity().finish(); } }); right.setOnClickListener(onClickListener); menu = (Button) getActivity().findViewById(R.id.title_menu_btn); menu.setVisibility(View.GONE); }
private void refreshProductStatus(int status) { PRODUCT_STATUS = status; if (PRODUCT_STATUS == PRODUCT_STATUS_PURCHASE) { if (mData.isFree) { mDownloadOrDeleteButton.setText(R.string.action_download); } else { mDownloadOrDeleteButton.setText( getString(R.string.action_purchase) + "(" + mData.price + ")"); } } else if (PRODUCT_STATUS == PRODUCT_STATUS_DOWNLOAD) { mDownloadOrDeleteButton.setText(R.string.action_download); } else if (PRODUCT_STATUS == PRODUCT_STATUS_DOWNLOADING) { mDownloadOrDeleteButton.setText(R.string.action_downloading); mDownloadOrDeleteButton.setVisibility(View.GONE); processView.setVisibility(View.VISIBLE); return; } else if (PRODUCT_STATUS == PRODUCT_STATUS_DOWNLOADED) { mDownloadOrDeleteButton.setText(R.string.action_install); } else if (PRODUCT_STATUS == PRODUCT_STATUS_INSTALLED) { if (isSupportApply(mData.type)) { mDownloadOrDeleteButton.setText(R.string.action_apply); } else { mDownloadOrDeleteButton.setText(R.string.action_delete); } } else if (PRODUCT_STATUS == PRODUCT_STATUS_APPLIED) { // mDownloadOrDeleteButton.setText(R.string.action_delete); mDownloadOrDeleteButton.setText(R.string.wallpaper_state_applied); } else if (PRODUCT_STATUS == PRODUCT_STATUS_NEED_UPDATE) { mDownloadOrDeleteButton.setText(R.string.action_update); } processView.setVisibility(View.GONE); mDownloadOrDeleteButton.setVisibility(View.VISIBLE); }
public void updateContentView(int position) { Log.v(TAG, "updateArticleView"); TextView article = (TextView) getActivity().findViewById(R.id.article); article.setText(Fragment_Array.Articles[position]); Button button = (Button) getActivity().findViewById(R.id.demo); button.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(getActivity(), DisplayMessageActivity_1.class); startActivity(intent); } }); ImageView img = (ImageView) getActivity().findViewById(R.id.img); img.setImageResource(R.drawable.unweb); if (position == 0) { button.setVisibility(View.VISIBLE); img.setVisibility(View.INVISIBLE); } else { button.setVisibility(View.INVISIBLE); img.setVisibility(View.VISIBLE); } mCurrentPosition = position; }
private void InitViews() { edSubject = (TouchEdit) findViewById(R.id.edCourseSubject); btnStartDate = (Button) findViewById(R.id.btnCourseStartDate); btnStartTime = (Button) findViewById(R.id.btnCourseStartTime); btnStartDate.setVisibility(ImageButton.VISIBLE); btnRepeatSelect = (Button) findViewById(R.id.btnRepeatSelect); btnRepeatSelect.setVisibility(ImageButton.INVISIBLE); btnStartDate.setVisibility(ImageButton.GONE); btnSave = (ImageButton) findViewById(R.id.btnCourseSave); btnSave.setOnClickListener( new View.OnClickListener() { public void onClick(View v) { SaveData(); } }); btnDelete = (ImageButton) findViewById(R.id.btnCourseDelete); btnDelete.setOnClickListener( new View.OnClickListener() { public void onClick(View v) { DeleteData(); } }); }
/** Initialize the views. */ private void initializeUI() { setCustomContentView(R.layout.activity_add_city, R.string.screen_name_city_select); btnBack = (Button) findViewById(R.id.nav_back_button); btnLoaction = (Button) findViewById(R.id.nav_location_button); btnBack.setVisibility(View.VISIBLE); btnLoaction.setVisibility(View.VISIBLE); hotCityListGridView = (GridView) findViewById(R.id.hot_city_list_grid_view); searchCityEditText = (AutoCompleteTextView) findViewById(R.id.search_name_edit_text); defaultHotCityList = getResources().getStringArray(R.array.hot_city_list); hotCityListGridView.setAdapter(new CityAdapter()); hotCityListGridView.setOnItemClickListener(onItemClickListener); searchCityEditText.addTextChangedListener(searchWatcher); adapter = new ArrayAdapter<String>( AddCitiyActivity.this, // 定义匹配源的adapter android.R.layout.simple_dropdown_item_1line, seachResultCityArrayList); searchCityEditText.setAdapter(adapter); searchCityEditText.setOnItemSelectedListener(onItemSelectedListener); btnBack.setOnClickListener(onClickListener); }
// 动画开启 private void startLogin() { Animation loAnimRotate = AnimationUtils.loadAnimation(this, R.anim.rotate); Animation loAnimScale = AnimationUtils.loadAnimation(this, R.anim.login_photo_scale_small); // 匀速动画 LinearInterpolator linearInterpolator = new LinearInterpolator(); // 加速动画 // AccelerateInterpolator accelerateInterpolator = new // AccelerateInterpolator(); // 弹跳动画 // BounceInterpolator bounceInterpolator = new BounceInterpolator(); loAnimRotate.setInterpolator(linearInterpolator); loAnimScale.setInterpolator(linearInterpolator); moImgProgress.setVisibility(View.VISIBLE); moImgProgress.startAnimation(loAnimRotate); moImgPhoto.startAnimation(loAnimScale); moImgSlider.setVisibility(View.GONE); moViewSlideLine.setVisibility(View.GONE); moEditUsername.setVisibility(View.GONE); moEditPassword.setVisibility(View.GONE); moBtnClearUsername.setVisibility(View.GONE); moBtnClearPassword.setVisibility(View.GONE); // moBtnRegister.setVisibility(View.GONE); moBtnTraveller.setVisibility(View.GONE); moLayoutWelcome.setVisibility(View.VISIBLE); }
// ------------------------------------------------------------------------------ private void luu() { String name = edit_ten.getText().toString(); int diemchoi = Integer.parseInt(text_diem.getText().toString()); // Nếu chưa nhập tên thì yêu cầu nhập tên if (name.length() == 0 || name == null) { Toast.makeText(this, "Bạn chưa nhập tên.", Toast.LENGTH_LONG).show(); return; } try { db.open(); Cursor c = db.getAllRows(); if (c.moveToPosition(9)) { String id = c.getString(c.getColumnIndex(Database.KEY_ROWID)); int math = c.getInt(c.getColumnIndex(Database.KEY_DIEM)); if (math < diemchoi) { db.updatePlayer(id, name, diemchoi); LinearLayout l = (LinearLayout) findViewById(R.id.linearLayout_diem); l.setVisibility(View.GONE); luu.setVisibility(View.GONE); xem_diem_cao.setVisibility(View.VISIBLE); xemdiemcao(); } } c.close(); db.close(); } catch (SQLiteException e) { e.printStackTrace(); } }
@SuppressWarnings("static-access") private void setview() { // TODO Auto-generated method stub if (identify != null) { if (identify.getStatus() == 0) { tv_show.setVisibility(View.VISIBLE); tv_show.setText("审核不通过。因为:"); ServiceLoader.getInstance() .displayImage( XswApplication.getInstance().getOptions(), identify.getPic(), relat_photo); } else if (identify.getStatus() == 1) { tv_show.setVisibility(View.VISIBLE); tv_show.setText("审核中,我们将在三个工作日内审核完成"); bt_upload.setVisibility(View.GONE); ServiceLoader.getInstance() .displayImage( XswApplication.getInstance().getOptions(), identify.getPic(), relat_photo); } else if (identify.getStatus() == 2) { tv_show.setVisibility(View.VISIBLE); tv_show.setText("恭喜你已经认证通过,快点完善其它资料吧"); bt_upload.setVisibility(View.GONE); ServiceLoader.getInstance() .displayImage( XswApplication.getInstance().getOptions(), identify.getPic(), relat_photo); } else { tv_show.setVisibility(View.VISIBLE); tv_show.setText("通过认证后,更有说服力~"); } } }
public void onEvent(MusicPlayEvent event) { music_bar_play.setVisibility(View.INVISIBLE); music_bar_pause.setVisibility(View.VISIBLE); music_bar_play.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { music_bar_play.setVisibility(View.INVISIBLE); music_bar_pause.setVisibility(View.VISIBLE); MusicService.playMusic(); } }); music_bar_pause.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { music_bar_pause.setVisibility(View.INVISIBLE); music_bar_play.setVisibility(View.VISIBLE); MusicService.pauseMusic(); } }); music_bar.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(ListOfMusic.this, MainActivity.class)); } }); }
public void setAllBtmButtonsVisible() { if (mAttributeButton != null) mAttributeButton.setVisibility(View.VISIBLE); if (mTemplateButton != null) mTemplateButton.setVisibility(View.VISIBLE); if (mTextButton != null) mTextButton.setVisibility(View.VISIBLE); if (mAlignButton != null) mAlignButton.setVisibility(View.VISIBLE); if (recycle != null) recycle.setVisibility(View.VISIBLE); }
@Override public void onTextChanged( final CharSequence s, final int start, final int before, final int count) { mLogger.info("onTextChanged", view); if ((view != null) && (view.getContent() instanceof EditableDrawable)) { final EditableDrawable editable = (EditableDrawable) view.getContent(); if (!editable.isEditing()) return; editable.setText(s.toString()); if (topHv.equals(view)) { editTopButton.setText(s); clearButtonTop.setVisibility( s != null && s.length() > 0 ? View.VISIBLE : View.INVISIBLE); } else if (bottomHv.equals(view)) { editBottomButton.setText(s); clearButtonBottom.setVisibility( s != null && s.length() > 0 ? View.VISIBLE : View.INVISIBLE); } view.forceUpdate(); setIsChanged(true); } }
private void isCodeText(Button codeInfo) { if (ZixuanActivity.addView.getSize() > 1) { codeInfo.setVisibility(Button.VISIBLE); } else { codeInfo.setVisibility(Button.GONE); } }
private void resetNetworkInfo() { int wifiState = wifiManager.getWifiState(); if (wifiState == WifiManager.WIFI_STATE_ENABLED) { setUIFromWifi(); wireRepoSwitchToWebServer(); repoSwitch.setVisibility(View.VISIBLE); enableWifiButton.setVisibility(View.GONE); } else { repoSwitch.setChecked(false); repoSwitch.setVisibility(View.GONE); enableWifiButton.setVisibility(View.VISIBLE); enableWifiButton.setText(R.string.enable_wifi); enableWifiButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { enableWifiButton.setText(R.string.enabling_wifi); wifiManager.setWifiEnabled(true); /* * Once the wifi is connected to a network, then * WifiStateChangeReceiver will receive notice, and kick off * the process of getting the info about the wifi * connection. */ } }); } }
@Override protected void onResume() { super.onResume(); // Check to see if we're resuming after having authenticated with // Twitter if (getIntent().getData() != null) { mOAuthManager.setAccessToken(getIntent()); if (mOAuthManager.loggedIn()) { startHomeActivity(); } else { Toast.makeText(this, "Login failed", Toast.LENGTH_SHORT).show(); mButtonLogin.setVisibility(View.VISIBLE); } } else { // No Intent with a callback Uri was found, so let's just see if // we've already logged in, and if so start the Home activity if (mOAuthManager.loggedIn()) { startHomeActivity(); } else { mButtonLogin.setVisibility(View.VISIBLE); } } }
@Override public void onAnimationStart(Animation animation) { if (!isAnimationOpen) { titlebar_leftmenu.setVisibility(View.GONE); titlebar_backbutton.setVisibility(View.VISIBLE); } }
public AlertDialog builder() { // ��ȡDialog���� View view = LayoutInflater.from(context).inflate(R.layout.view_alertdialog, null); // ��ȡ�Զ���Dialog�����еĿؼ� lLayout_bg = (LinearLayout) view.findViewById(R.id.lLayout_bg); txt_title = (TextView) view.findViewById(R.id.txt_title); txt_title.setVisibility(View.GONE); txt_msg = (TextView) view.findViewById(R.id.txt_msg); txt_msg.setVisibility(View.GONE); btn_neg = (Button) view.findViewById(R.id.btn_neg); btn_neg.setVisibility(View.GONE); btn_pos = (Button) view.findViewById(R.id.btn_pos); btn_pos.setVisibility(View.GONE); img_line = (ImageView) view.findViewById(R.id.img_line); img_line.setVisibility(View.GONE); // ����Dialog���ֺͲ��� dialog = new Dialog(context, R.style.AlertDialogStyle); dialog.setContentView(view); // ����dialog������С lLayout_bg.setLayoutParams( new FrameLayout.LayoutParams((int) (display.getWidth() * 0.85), LayoutParams.WRAP_CONTENT)); return this; }
private void searchFromCache(String keyword) { TextView errorText = (TextView) mErrorView.findViewById(R.id.error_view_error_text); errorText.setText(getString(R.string.PleaseCheckNetworkAndTryAgain)); mRetryBtn.setVisibility(View.VISIBLE); if (mErrorView.getVisibility() == View.VISIBLE) { mErrorView.setVisibility(View.GONE); } if (keyword.length() > 0) { mPartyListRecyclerView.setVisibility(View.VISIBLE); mErrorView.setVisibility(View.GONE); mParties = mPartyAPIHelper.searchPartiesFromCache(keyword); if (mParties != null && mParties.size() > 0) { mPartyAdapter.setParties(mParties); mPartyAdapter.setOnItemClickListener(PartyListActivity.this); } else { mPartyListRecyclerView.setVisibility(View.GONE); mErrorView.setVisibility(View.VISIBLE); mRetryBtn.setVisibility(View.GONE); errorText.setText(R.string.search_not_found); } } else { downloadPartyList(); } }
private void isCodeText(Button codeInfo) { if (addviewmiss.getSize() > 1) { codeInfo.setVisibility(Button.VISIBLE); } else { codeInfo.setVisibility(Button.GONE); } }
public void onClick(View v) { if (v == btnConnect) { try { networkConnection = new NetworkConnection( progressBar, getString(R.string.simplehttpurl), this, connectIntent, INTENT_NEXT_SCREEN); networkConnection.start(); btnConnect.setVisibility(Button.INVISIBLE); btnCancel.setVisibility(Button.VISIBLE); } catch (Exception ex) { Log.e(getClass().getName(), "Error on onClick btnConnect ", ex); } } else if (v == btnCancel) { if (networkConnection != null) { try { networkConnection.close(); } catch (Exception ex) { Log.e(getClass().getName(), "Error on onClick btnCancel ", ex); } } reset(); } }
public void onPictureTaken(byte[] data, Camera camera) { picture = data; Button saveButton = (Button) findViewById(R.id.savePhotoButton); saveButton.setVisibility(View.VISIBLE); Button cameraTryAgainButton = (Button) findViewById(R.id.cameraTryAgainButton); cameraTryAgainButton.setVisibility(View.VISIBLE); }
@Override public void onItemSelected(AdapterView<?> adapter, View vview, int position, long id) { // 获取选择的项的值 if (curStage != position) { for (int i = 0; i < stageList.length; i++) { for (int j = 0; j < stageList[i].nodeList.length; j++) { for (int k = 0; k < stageList[i].nodeList[j].deviceList.length; k++) { int curId = i * 1000 + j * 100 + k; Button curButton = (Button) view.findViewById(curId); if (i == position) curButton.setVisibility(View.VISIBLE); else curButton.setVisibility(View.GONE); } } } Button curButton = (Button) view.findViewById(curSelect); curButton.setBackgroundResource(R.drawable.focus_false); curStage = position; frameLayout = (FrameLayout) view.findViewById(R.id.container); if (curStage == 0) { frameLayout.setBackgroundResource(R.drawable.map911); Button firstButton = (Button) view.findViewById(0); firstButton.setBackgroundResource(R.drawable.focus_true); ChangeButton(0); curSelect = 0; } else { frameLayout.setBackgroundResource(R.drawable.map631); Button firstButton = (Button) view.findViewById(1000); firstButton.setBackgroundResource(R.drawable.focus_true); ChangeButton(1000); curSelect = 1000; } } }