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

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -