Android ListView ArrayAdapter getting data from host activity? -
i have custom arrayadapter
use populate listview
in activity
. logic in getview
method of arrayadapter
requires additional piece of information held in instance variable in host activity
. what's best way of accessing variable within getview
method of arrayadapter
?
public class customarrayadapter extends arrayadapter<string> { string addinfo; public customarrayadapter(string additionalinfo) { addinfo=additionalinfo; } }
when creating object arrayadapter, use below
customarrayadapter custadapter=new customarrayadapter("additional info");
Comments
Post a Comment