作者push583 (阿昌)
看板AndroidDev
标题[问题] 新手发问
时间Wed Jan 12 23:48:26 2011
Which level: (app/frmwrk/lib/kernel)
Question:
Input:
Expected Output:
Wrong Output:
Code: (请多利用置底文网站)
References: (Books/Websites/...)
Supplement:
小弟最近自学於Android上开发,常常遇到需要传递Context类别参数传递,
对於Context类别叙述原文如下 :
Class Overview
Interface to global information about an application environment.
This is an abstract class whose implementation is provided by
the Android system. It allows access to application-specific
resources and classes, as well as up-calls for application-level
operations such as launching activities, broadcasting and
receiving intents, etc
依小弟认知,他是指这类别靠Android系统实现,去允许存取特殊应用的资源跟类别,
要求应用层级操作,如启动activities、broadcasting和接收intents等,但是
还是有点难以理解,是否有人可以白话一点解释Context的作用?
另外,传递Context context这种参数时(如PendingIntent.getActivity
(Context context, int requestCode, Intent intent, int flags)
...等等)为什麽可以用this传递?
谢谢大家~~
PS:我是帮朋友PO的,若高手有见解再请回覆到以下mail
[email protected]
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 114.38.11.33
1F:推 nowar100:1. 千万不要用这种烂标题,上次有人这样用,结果... 01/13 02:03
2F:→ nowar100:2. 因为 Activity 有继承到 Context,所以传 this 即可 01/13 02:03
3F:→ nowar100:最後碎碎念一下 求助发问还要别人主动寄信到您信箱 01/13 02:05
4F:→ nowar100:这是讨论板阿 老大 不是求神问卦区阿... :( 01/13 02:06
5F:推 yienge:看来原PO还兼BBS新手 发问格式也不合喔ˇˇ 01/13 12:48