Created
April 27, 2014 01:06
-
-
Save b3457m0d3/11335196 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//this is how you ask the editor to perform tasks | |
/*ex) | |
* | |
* | |
public void issueIntent(int requestCode, String[] data){ | |
Intent openNewActivity = new Intent(getApplicationContext(), IntentHandler.class); | |
b.putStringArray("data", data); | |
openNewActivity.putExtras(b); | |
startActivityForResult(openNewActivity, requestCode); | |
} | |
@Override | |
public void onActivityResult(int requestCode, int resultCode, Intent data) { | |
switch (requestCode) { | |
case CREATE_NEW_NOTE: | |
if (resultCode == RESULT_OK) { | |
//retrieve the data | |
bookName = data.getStringExtra("bookName"); | |
//grab a string from xml and make it dynamic | |
text = String.format(res.getString(R.string.create_note_msg), bookName); | |
Toast.makeText(this, text, Toast.LENGTH_LONG); | |
} else if (resultCode == RESULT_CANCELED) { | |
Toast.makeText(this, RESULT_ERROR, Toast.LENGTH_LONG); | |
} | |
break; | |
case DELETE_NOTE: | |
if (resultCode == RESULT_OK) { | |
//retrieve the data | |
bookName = data.getStringExtra("bookName"); | |
//grab a string from xml and make it dynamic | |
text = String.format(res.getString(R.string.delete_note_msg), bookName); | |
Toast.makeText(this, text, Toast.LENGTH_LONG); | |
} else if (resultCode == RESULT_CANCELED) { | |
Toast.makeText(this, RESULT_ERROR, Toast.LENGTH_LONG); | |
} | |
break; | |
case CREATE_NEW_PAGE: | |
if (resultCode == RESULT_OK) { | |
result = "creating new page"; | |
Toast.makeText(this, result, Toast.LENGTH_LONG); | |
} else if (resultCode == RESULT_CANCELED) { | |
Toast.makeText(this, RESULT_ERROR, Toast.LENGTH_LONG); | |
} | |
break; | |
case LOAD_NOTE: | |
if (resultCode == RESULT_OK) { | |
result = "loading note"; | |
Toast.makeText(this, getString(R.string.loaded_note_msg), Toast.LENGTH_LONG); | |
} else if (resultCode == RESULT_CANCELED) { | |
Toast.makeText(this, RESULT_ERROR, Toast.LENGTH_LONG); | |
} | |
break; | |
} | |
}*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment