#Region Project Attributes #ApplicationLabel: listviewtest#versioncode:20140625#versionname: ' Supportedorientations Possible values:unspecified, landscape or Portrait. #SupportedOrientations: Unspecified#caninstalltoexternalstorage: False#end region#region Activity Attributes #FullScreen: false#includetitle:true#end regionsub process_globals ' These Global variables would be declared once when the application starts. ' These variables can is accessed from all modules. ' This project was modified in the Basic4android Development tutorial translation (eight) using the ListView "End SubSub Globals ' These Glob Al variables'll be redeclared each time the activity is created. ' These variables can only is accessed from the This module. Private Lvwbrowser as ListView ' declaration component End SubSub Activity_create (firsttime as Boolean) ' Do not forget to load the layout fil E created with the visual designer. For Example:Activity.LoadLayout ("1") Dim gd as gradientdrawable ' gradient effect class, gradientdrawable supports the use of gradients to draw a graphic GD. Initialize ("Top_bottom", Array as Int (Colors.black, Colors.lightgray)) ' firstParameters define the direction of the gradient, with the following values to select ' Top_bottom ' "top-down" ' "TR_BL" (Top-right to Bottom-left) (top-left) ' Right_left ' "right-to-left" Br_tl "(Bottom-right to Top-left)" Br_tl "(top left and right) ' bottom_top '" bottom-up "'" Bl_tr "(Bottom-left to Top-right)" Bl_tr "(top left and right) '" Left_right "" left-to-right "" Tl_br "(Top-left to Bottom-right) (top left-to-right) Activity.background = GD ' Activity window Body background using the gradient effect lvwbrowser.width =100%xlvwbrowser.scrollingbackgroundcolor = Colors.transparent ' vertical scrollbar background color = Transparent Lvwbrowser.initialize ("Lvwbrowser") LvwBrowser.SingleLineLayout.Label.TextSize = 20 ' Font size LvwBrowser.SingleLineLayout.Label.TextColor = Colors.green ' font Color lvwBrowser.SingleLineLayout.Label.Gravity = Gravity.left ' font display position lvwBrowser.SingleLineLayout.ItemHeight = 60dip ' Row height lvwBrowser.TwoLinesLayout.Label.TextSize =20 ' Font size LvwBrowser.TwoLinesLayout.Label.TextColor =colors.yellow ' Font Color lvwBrowser.TwoLinesLayout.SecondLabel.TextSize = 20 ' font size LvwBrowser.TwoLinesLayout.SecondLabel.TextColor = Colors.red ' Font Color lvwbrowser.fastscrollenableD = True ' Fast scroll ' Dim bitmapicon As Bitmapbitmapicon.initialize (file.dirassets, "1.png") Dim i as Int for I=1 to 20lvwBrowser . Addsingleline ("line item (addsingleline)" & i) Lvwbrowser.addtwolines ("Text double line item (addtwolines)" & I, "-Second row text--" & I ) Lvwbrowser.addtwolinesandbitmap ("Graph double line item" & I, "--second row text--" & I,bitmapicon) Nextactivity.addview (Lvwbrowser, 0, 0, 100%x, 100%y) End SubSub Activity_resumeend SubSub Activity_pause (userclosed as Boolean) End SubSub Lvwbrowser_itemcl Ick (Position as Int, value as Object) ' parameter Position is the list item index ' parameter Value is the list item text Activity.title = "(" & Position & " ) "&"-"& ValueEnd Sub