[android-developers] Re: How to add menu item dynamically

2008-12-01 Thread Eric Mill

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 android-developers@googlegroups.com
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
-~--~~~~--~~--~--~---



[android-developers] Re: How to add menu item dynamically

2008-12-01 Thread Xavier Mathews

What About Using RSS Method With Arrays?

On 12/01/2008, Eric Mill [EMAIL PROTECTED] wrote:

 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
 



-- 
Xavier A. Mathews
Student/Browser Specialist/Developer/Web-Master
Google Group Client Based Tech Support Specialist
Hazel Crest Illinois
[EMAIL PROTECTED]@[EMAIL PROTECTED]
Fear of a name, only increases fear of the thing itself.

--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to add menu item dynamically

2008-12-01 Thread souvik

Thanks for the suggestion...
Can u please provide a peice of code for this!!!

-piku

On Dec 2, 5:03 am, Eric Mill [EMAIL PROTECTED] wrote:
 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 android-developers@googlegroups.com
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
-~--~~~~--~~--~--~---