Permalink
Browse files

Remove onUpListener; not the best idea

Signed-off-by: Eddie Ringle <eddie@eringle.net>
  • Loading branch information...
1 parent b11516f commit 3f262eb821599bb573ebc0d20e40f8ce634700dd @EddieRingle committed Jun 23, 2012
Showing with 8 additions and 24 deletions.
  1. +8 −24 src/net/idlesoft/android/apps/github/ui/activities/BaseActivity.java
@@ -108,12 +108,6 @@ void onBackStackChanged()
}
};
- public interface OnUpListener {
- public boolean onUp(final BaseActivity activity);
- }
-
- protected OnUpListener mOnUpListener;
-
public
Context getContext()
{
@@ -269,12 +263,6 @@ void popShortToast(final String message)
}
public
- void setOnUpListener(final OnUpListener listener)
- {
- mOnUpListener = listener;
- }
-
- public
void onCreateActionBar(ActionBar bar)
{
mCreateActionBarCalled = true;
@@ -310,26 +298,22 @@ boolean onCreateOptionsMenu(Menu menu)
public
boolean onOptionsItemSelected(MenuItem item)
{
+ final Intent intent;
+
switch (item.getItemId()) {
case android.R.id.home:
- if ((getSupportActionBar().getDisplayOptions() & DISPLAY_HOME_AS_UP)
- == DISPLAY_HOME_AS_UP
- && mOnUpListener != null) {
- mOnUpListener.onUp(this);
- } else {
- final Intent intent = new Intent();
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
- intent.setClass(getApplicationContext(), MainActivity.class);
- startActivity(intent);
- finish();
- }
+ intent = new Intent();
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
+ intent.setClass(getApplicationContext(), MainActivity.class);
+ startActivity(intent);
+ finish();
return true;
case R.id.actionbar_action_select_account:
startActivity(AccountSelect.class);
return true;
case R.id.actionbar_action_report_issue:
- final Intent intent = new Intent();
+ intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://github.com/eddieringle/hubroid/issues"));
startActivity(intent);

0 comments on commit 3f262eb

Please sign in to comment.