You could just have a piece of code that reads in the text file,
parses it into an array of items, and then loops through that array to
add the items to the menu.  It's not conceptually different than doing
it statically.  The XML inflate method isn't going to work for dynamic
data, so it'll have to happen in your code.

-- Eric

On Dec 1, 1:01 am, souvik <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I want to add menu item dynamically.
>
> Instead of adding items like this mentioned below, how can I add item
> dynamically?
> items.add( "item1" );
> items.add( "item2" );
>
> I have a file "a1.txt" and the content of the file is like:
> a1.txt
> =========
> 1.Question1
> 2.Question2
> 3.Question3
>
> Now i want to read this "a1.txt" and add "1.Question1" ,"2.Question2"
> as menu item.
>
> Please provide some sample code.
> Thanks,
> Souvik
--~--~---------~--~----~------------~-------~--~----~
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