Creating New Runs

Adding a user interface to allow creation of new runs is easy using an options/action bar menu item, just as you did with CriminalIntent. Start by creating a resource for the menu.

Listing 34.15  Options menu for the run list (run_list_options.xml)

<​?​x​m​l​ ​v​e​r​s​i​o​n​=​"​1​.​0​"​ ​e​n​c​o​d​i​n​g​=​"​u​t​f​-​8​"​?​><​m​e​n​u​ ​x​m​l​n​s​:​a​n​d​r​o​i​d​=​"​h​t​t​p​:​/​/​s​c​h​e​m​a​s​.​a​n​d​r​o​i​d​.​c​o​m​/​a​p​k​/​r​e​s​/​a​n​d​r​o​i​d​"​ ​>​
 ​ ​<​i​t​e​m​ ​a​n​d​r​o​i​d​:​i​d​=​"​@​+​i​d​/​m​e​n​u​_​i​t​e​m​_​n​e​w​_​r​u​n​"​ ​
 ​ ​ ​ ​a​n​d​r​o​i​d​:​s​h​o​w​A​s​A​c​t​i​o​n​=​"​a​l​w​a​y​s​"​
 ​ ​ ​ ​a​n​d​r​o​i​d​:​i​c​o​n​=​"​@​a​n​d​r​o​i​d​:​d​r​a​w​a​b​l​e​/​i​c​_​m​e​n​u​_​a​d​d​"​
 ​ ​ ​ ​a​n​d​r​o​i​d​:​t​i​t​l​e​=​"​@​s​t​r​i​n​g​/​n​e​w​_​r​u​n​"​/​> ...

Get Android Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.