コード例 #1
0
  @Override
  public void onDestroy() {
    super.onDestroy();

    // Disconnect capability API
    capabilityApi.disconnectApi();
  }
コード例 #2
0
 protected Void doInBackground(Void... unused) {
   try {
     // Refresh all
     api.refreshAllCapabilities();
   } catch (ClientApiException e) {
     // Display error
     Utils.showMessage(RefreshCapabilities.this, getString(R.string.label_refresh_failed));
   }
   return null;
 }
コード例 #3
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Set layout
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    setContentView(R.layout.capabilities_refresh);

    // Set title
    setTitle(R.string.menu_refresh_capabilities);

    // Set buttons callback
    Button btn = (Button) findViewById(R.id.refresh_btn);
    btn.setOnClickListener(btnSyncListener);

    // Instanciate contacts API
    capabilityApi = new CapabilityApi(getApplicationContext());
    capabilityApi.addApiEventListener(this);
    capabilityApi.connectApi();
  }