@Override public void onServiceConnected(ComponentName name, IBinder service) { // TODO Auto-generated method stub if (name.getShortClassName().equals(API_SERVICE_NAME)) { apiServiceInterface = ApiServiceInterface.Stub.asInterface(service); if (data.isEmpty()) { try { // setProgressBarIndeterminateVisibility(true); showProgressDialog(); // Prepare Parameters Map<String, Object> parameters; parameters = new HashMap<String, Object>(); Bundle bundle = this.getIntent().getExtras(); parameters.put("uid", bundle.getString("uid")); parameters.put("aid", bundle.getString("aid")); if ("4".equals(bundle.getString("visible"))) { parameters.put("password", bundle.getString("password")); } // Request apiServiceInterface.request( statusData.getCurrentService(), CommHandler.TYPE_GET_ALBUM_PHOTOS, apiServiceListener, parameters); } catch (RemoteException e) { e.printStackTrace(); } } } }
@Override public void onClick(View v) { switch (v.getId()) { case R.id.send: { if (statusData.getCurrentService().equals(IGeneral.SERVICE_NAME_SINA) || statusData.getCurrentService().equals(IGeneral.SERVICE_NAME_TENCENT)) { if ("".equals(mEditStatus.getText())) { Toast.makeText( UpdateTagsActivity.this, getString(R.string.alert_input_data), Toast.LENGTH_SHORT) .show(); } else if (statusData.getCurrentService().equals(IGeneral.SERVICE_NAME_SINA) && mEditStatus.getText().length() > 7 || statusData.getCurrentService().equals(IGeneral.SERVICE_NAME_TENCENT) && mEditStatus.getText().length() > 8) { Toast.makeText( UpdateTagsActivity.this, getString(R.string.alert_input_data_overflow), Toast.LENGTH_SHORT) .show(); } else { showProgressDialog(); // Prepare Parameters Map<String, Object> parameters; parameters = new HashMap<String, Object>(); parameters.put("tags", mEditStatus.getText().toString()); // Request try { apiServiceInterface.request( statusData.getCurrentService(), CommHandler.TYPE_UPDATE_TAGS, apiServiceListener, parameters); } catch (RemoteException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } break; } case R.id.head_refresh: { Intent home = new Intent(UpdateTagsActivity.this, HomeTimelineActivity.class); home.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); startActivity(home); break; } case R.id.head_back: { finish(); break; } default: break; } }
// -------------------------------------------------------------- private void registerToken(String accessToken, String tokenSecret) { // Prepare Parameters For Request Map<String, Object> parameters; parameters = new HashMap<String, Object>(); parameters.put("accessToken", accessToken); parameters.put("tokenSecret", tokenSecret); try { // HTTP Communication apiServiceInterface.request( IGeneral.SERVICE_NAME_SINA, CommHandler.TYPE_VERIFY_USER, apiServiceListener, parameters); } catch (RemoteException e) { e.printStackTrace(); } }