you can do this in your activity class :
first : use inflate the Linearlayout like this
Linearlayout mLL = View.inflate(...)
then you can try method ListView.addHeader(mLL,...)
to add the layout to the top of the listView
forgive for my poor english
sorry about last reply , It seems i just get the content of another thread i want to reply into yours ...
And about the two contexts , the main difference is about their lifecycle , the ActivityContext dies as soon as the Activity which it attached is destroyed , in the same way , The ApplicationContext Survives during the whole Application's lifecycle ,the Application context has more Competence ,higer level overall . this is what i know . And about how to choose between them , i suggest that you obey the "enough rule ", choose activity context first , here comes an example , if you want to show a alertDialog just in one of your activity ,then you shouold choose activity context rather than Application context
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.