android - Will my application benefit from launch modes and intent flags? -


i have written simple sudoku solving app looks this: link

when press button, keypad show lets select number asign button. typical use case user opens app assigns numbers make sudoku puzzle want solve , press solve button.

from understanding of android create task made of lot of main , keypad activities (the keypad activity dialog). every time assign new number put keypad activity on top of main 1 when keypad appears. when have selected number , keypad dissappears put main activity on top of keypad activity.

is how works out lot of activitys dont need? have misunderstood thing?

should use launch modes , intent flags reuse same main activty , keypad on , on again or fine use standard version?

from understand of problem, can use intent flag flag_activity_reorder_to_front. if activity on stack will, says, bring top of stack don't have multiple instances of it.

something like

 intent = new intent(mainactivity.this, keypadactivity.class);  i.setflags(intent.flag_activity_reorder_to_front);  startactivity(i); 

you can find available flags here in docs

also, calling finish() on keypad activity when done , go next 1 take off of stack.

google navigation presentation


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -