package eu.nerro.wolappla.ui;

import android.app.ActionBar;
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.view.MenuItem;

import eu.nerro.wolappla.R;

public class DeviceDetailActivity extends Activity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    final ActionBar actionBar = getActionBar();
    if (actionBar != null) {
      actionBar.setDisplayHomeAsUpEnabled(true);
    }

    setContentView(R.layout.activity_device_detail);
  }

  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
      case android.R.id.home:
        NavUtils.navigateUpFromSameTask(this);
        return true;
    }

    return super.onOptionsItemSelected(item);
  }
}

@@ -83,16 +83,47 @@
 tivity;%0A
+import android.content.Intent;%0A
 import a
@@ -214,35 +214,173 @@
 em;%0A
-%0Aimport eu.nerro.wolappla.R
+import android.view.View;%0Aimport android.widget.Button;%0Aimport android.widget.EditText;%0A%0Aimport eu.nerro.wolappla.R;%0Aimport eu.nerro.wolappla.provider.DeviceContract
 ;%0A%0Ap
@@ -724,16 +724,1405 @@
 detail);
+%0A%0A    Button saveButton = (Button) findViewById(R.id.device_detail_save_button);%0A    saveButton.setOnClickListener(new View.OnClickListener() %7B%0A      @Override%0A      public void onClick(View view) %7B%0A        Intent intent = getIntent();%0A%0A        EditText deviceNameView = (EditText) findViewById(R.id.device_detail_name);%0A        intent.putExtra(DeviceContract.Devices.DEVICE_NAME, deviceNameView.getText().toString());%0A        EditText deviceMacAddressView = (EditText) findViewById(R.id.device_detail_mac_address);%0A        intent.putExtra(DeviceContract.Devices.DEVICE_MAC_ADDRESS, deviceMacAddressView.getText().toString());%0A        EditText deviceIpAddressView = (EditText) findViewById(R.id.device_detail_ip_address);%0A        intent.putExtra(DeviceContract.Devices.DEVICE_IP_ADDRESS, deviceIpAddressView.getText().toString());%0A        EditText devicePortView = (EditText) findViewById(R.id.device_detail_port);%0A        intent.putExtra(DeviceContract.Devices.DEVICE_PORT, Integer.valueOf(devicePortView.getText().toString()));%0A%0A        setResult(RESULT_OK, intent);%0A        finish();%0A      %7D%0A    %7D);%0A%0A    Button cancelButton = (Button) findViewById(R.id.device_detail_cancel_button);%0A    cancelButton.setOnClickListener(new View.OnClickListener() %7B%0A      @Override%0A      public void onClick(View view) %7B%0A        setResult(RESULT_CANCELED, getIntent());%0A        finish();%0A      %7D%0A    %7D);
 %0A  %7D%0A%0A  

Add actions for save and cancel buttons in device detail activity