浏览 2852 次
锁定老帖子 主题:Activity & Context
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2010-01-12
最后修改:2010-01-12
How to do: 1. public class MyExample extends Activity. <activity android:name=".SystemUpApp" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> * MyExample is main entrance of this application 2. public class MySample public class MySample{ Activity activity; Context context; public MySample(Activity a,Context c) { activity = a; context = c; 3. How to new MySample instance. MySample sample = new MySample(this,this); 4. How to use activity or context. TextView tv = new TextView(activity); That's all! 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |