Yea, went through the document and got good understanding of activities &
tasks.

I observed one issue though (Not sure if its an issue, maybe I need to call
some other functions).

In my first list A, I selected one item using Keys. This leads to create
another list Activity B. I just browsed the list using Key, so that one
element will be highlighted (focussed). These activities are created with
Launch mode "singleTop"
Then I went to the Home Screen. Now on selecting my Activity Icon again, I
got the list Activity B screen but its not highlighted. Using onPause, I got
the "position" and in onResume I called setSelection(position). But still
that element in the list is not highlighted

Any Suggestions?

Thanks

On Thu, Jan 28, 2010 at 11:52 AM, theSmith <[email protected]> wrote:

>
>
> On Jan 27, 7:03 pm, android beginner <[email protected]>
> wrote:
> > Hi,
> > The basic list that I want to view is working.
> >
> > In my first list activity(ListDemoActivity), I choosed some element,
> which
> > triggers another list A activity. If I go back (on pressing "BACK" key),
> the
> > state of ListDemoActivity screen is preserved. Now If I select the same
> > element again, I expect the state of A activity to be preserved aswell,
> but
> > its not happening.
>
> You're assuming things that are not true.  Its an activity stack, so
> once you pop it off (hit the back key) that state is lost, and you
> will be creating a new activity when launching that activity A again.
>
> I'd recommend learning a little bit about the nature of android before
> getting too deep into developing code.
> The Androidology videos will get you started and the Google I/O videos
> are some of my favorites for getting into Android as a pro.
> http://developer.android.com/intl/de/videos/index.html#v=opZ69P-0Jbc
>
>
> > Below is the code snippet, Can you please suggest me what I need to do?
> >
> > public class ListDemoActivity extends ListActivity {
> >     String[] firstPage = {"a", "b", "c", "d", "e"};
> >     /** Called when the activity is first created. */
> >     @Override
> >     public void onCreate(Bundle savedInstanceState) {
> >         super.onCreate(savedInstanceState);
> >         setContentView(R.layout.main);
> >
> >         setListAdapter(new ArrayAdapter<String>(this,
> >                         android.R.layout.simple_list_item_1,
> >                         firstPage));
> >
> >     }
> >
> >     public void onListItemClick(ListView parent, View v,
> >                                 int position, long id)
> >     {
> >         String txt = firstPage[position];
> >         if ((txt == "a") ||
> >             (txt == "b"))
> >         {
> >             Intent startActivity = new Intent(this, Activity_A.class);
> >             startActivity.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
> >
> >             startActivity(startActivity);
> >         }
> >         else
> >         {
> >             Intent startActivity = new Intent(this, Activity_B.class);
> >             startActivity.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
> >
> >             startActivity(startActivity);
> >         }
> >
> >     }
> >
> > }
> > On Tue, Jan 26, 2010 at 5:28 PM, theSmith <[email protected]>
> wrote:
> >
> > > On Jan 25, 11:48 pm, android beginner <[email protected]>
> > > wrote:
> > > > so, each sub-lists should be created as list activity. On selecting
> any
> > > > item, should call that particular list activity. Is my understanding
> > > > correct?
> >
> > > Yes
> >
> > > > Also, how to store parent list in the stack? so that on pressing
> "escape"
> > > > key, I can navigate backwards.
> >
> > > Android does this automatically, and I assume you mean the 'back'
> > > key.  Each new activity is launched ontop of the older ones allowing
> > > you to navigate backwards down the stack.
> >
> > > -theSmith
> >
> > > > Thanks
> >
> > > > On Tue, Jan 26, 2010 at 9:11 AM, saad bouchehboun <
> [email protected]
> > > >wrote:
> >
> > > > > your item must be a listactivity , when you add it to your parent
> > > > > list , the UI is adapted automaticly .
> >
> > > > > On 25 jan, 06:24, android beginner <[email protected]>
> > > > > wrote:
> > > > > >  Hi,
> >
> > > > > > My Activity has list of items and on clicking any item, new
> window
> > > with
> > > > > > different set of list has to appear and this can continue upto 4
> or 5
> > > > > level
> > > > > > depths. I need your expert advice on how to achieve this.
> >
> > > > > > Can I have each sub-list to be of separate activity? If there are
> any
> > > > > online
> > > > > > examples matching this requirement, please let me know.
> >
> > > > > > Thank
> >
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > > > > Groups "Android Developers" group.
> > > > > To post to this group, send email to
> > > [email protected]
> > > > > To unsubscribe from this group, send email to
> > > > > [email protected]<android-developers%[email protected]>
> <android-developers%[email protected]<android-developers%[email protected]>
> >
> > > <android-developers%[email protected]<android-developers%[email protected]>
> <android-developers%[email protected]<android-developers%[email protected]>
> >
> >
> > > > > 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 post to this group, send email to
> [email protected]
> > > To unsubscribe from this group, send email to
> > > [email protected]<android-developers%[email protected]>
> <android-developers%[email protected]<android-developers%[email protected]>
> >
> > > 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 post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> 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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to