Skip to content

Commit

Permalink
Handle clicking of actionbar icon.
Browse files Browse the repository at this point in the history
  • Loading branch information
hdweiss committed Mar 9, 2012
1 parent ac17a10 commit 41887fd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/com/matburt/mobileorg/Gui/Capture/EditActivity.java
Expand Up @@ -100,7 +100,11 @@ private void init() {
if (this.actionMode == null) {
String subject = intent
.getStringExtra("android.intent.extra.SUBJECT");
if(subject == null)
subject = "";
String text = intent.getStringExtra("android.intent.extra.TEXT");
if(text == null)
text = "";

node = new NodeWrapper(null);
this.detailsFragment.init(this.node, this.actionMode, defaultTodo, subject);
Expand Down Expand Up @@ -198,6 +202,7 @@ public boolean onCreateOptionsMenu(android.support.v4.view.Menu menu) {
public boolean onOptionsItemSelected(android.support.v4.view.MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
doCancel();
return true;

case R.id.nodeedit_save:
Expand Down
3 changes: 3 additions & 0 deletions src/com/matburt/mobileorg/Gui/NodeViewActivity.java
Expand Up @@ -84,6 +84,9 @@ public boolean onCreateOptionsMenu(android.support.v4.view.Menu menu) {
@Override
public boolean onOptionsItemSelected(android.support.v4.view.MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
break;
case R.id.viewmenu_edit:
runEditNodeActivity();
break;
Expand Down
5 changes: 5 additions & 0 deletions src/com/matburt/mobileorg/Gui/OutlineActivity.java
Expand Up @@ -156,6 +156,11 @@ public boolean onCreateOptionsMenu(android.support.v4.view.Menu menu) {
@Override
public boolean onOptionsItemSelected(android.support.v4.view.MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
if(this.node_id != -1)
finish();
return true;

case R.id.menu_sync:
runSync();
return true;
Expand Down

0 comments on commit 41887fd

Please sign in to comment.