如何获取当前上下文? [英] How to get the current context?
本文介绍了如何获取当前上下文?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在我的阵列适配器中使用它.当我将 this
放在子活动中以创建适配器时,它将不起作用.
I want to use it in my array adapter. When I put this
in a sub-activity to create an adapter it does not work.
推荐答案
getApplicationContext()
can get the context value
这篇关于如何获取当前上下文?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文