开发者

What is the applicationcontext in makeTest() Method, please explain with the following snippet

Toast.makeTes开发者_StackOverflow中文版t(HelloGridView.this,"Text to be displayed",Toast.LENGTH.SHORT).show();

What is the 'HelloGridView.this' refers? why it is called as appliactioncontext?


It's called context because HelloGridView.this (Activity class) extends the Context class (not directly, but it extends another class, which extends another, which in turn extends the Context class).

It's a grand grand child of the Context class.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜