*"What am i doing wrong that i have to hit back so many times to get back
to where i was originally?"*

Talk about a loaded question... You are apparently using activities for
each of your screens.  That is fine, but when you call startActivity() from
within another activity that is the default behavior you get with the back
button.  This is a very basic Android concept.

I highly suggest before you do ANY more development you take some time to
read through the Design section (specifically the pattern sub-section) of
the Android Developer website and figure out how you want your app to work.

http://developer.android.com/design/patterns/index.html

Once you've figured out HOW you want your app to work, and the different
patterns available, you can then start developing your app and ask more
specific questions.

On Wed, Apr 8, 2015 at 12:10 PM Dan Cha <cuban...@gmail.com> wrote:

> So within my app currently, we have 3 main pages.
>
> The main home page
> A create/submit page
> and a view page
>
> Because those pages work off webservice to populate 2 drop downs, i wanted
> to create "settings/options" where the user can manage the data within the
> drop down.
>
> So current i have the menu setup in the top left corner of the pages, when
> you click that, you get the dropdown menu with a few options..
>
> But something i noticed, is if i chose any item from that menu, and then
> chose another menu item and then again another item, only way to get back
> to the original window i was on is to hit back x number of times(x being
> how ever many menu items i chose to select.
>
> Here is my code to open the new selected menu item:
>
> @Override
> public boolean onOptionsItemSelected(MenuItem item) {
>     Intent intent = new Intent();
>     switch (item.getItemId())
>     {
>     case R.id.action_settings:
>     intent.setComponent(new ComponentName(ViewInventoryActivity.this,
> SettingsActivity.class));
>     startActivity(intent);
>     return true;
>
>             case R.id.action_about:
>                 intent.setComponent(new
> ComponentName(ViewInventoryActivity.this, AboutActivity.class));
>                 startActivity(intent);
>                 return true;
>     }
>     return super.onOptionsItemSelected(item);
> }
>
> What am i doing wrong that i have to hit back so many times to get back to
> where i was originally?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to