• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Ranking programming issue

bobitz

Lurker
What's the difference between the application context and an activity context? When would you use either?

I'd really appreciate your help.

Thanks.
 
Last edited:
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

hope helps :D
 
Thanks, that helped me.
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 :)
 
Back
Top Bottom