android 写了一个类,但这个类没有继承activity,我想在这个类中用到toast信息提示 如题大家有没有遇到这么问题?求教高手! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 getApplicationContext() class YourClass {private Context context; public YourClass(Context context) { this.context = context;}} 从外面传一个context进来,用这个context调用 Toast.makeText(context,"文本内容",2000).show();只需要通过方法参数把context传过来就行一般就是xxx页面.this Android如何实现通知栏点击事件:我想通过点击通知栏中的一栏显示一个对话框? 基于asmack的android应用在关闭数据连接后重新打开,如何实现自动重连? android x86 平台 触摸屏驱动移植 自定义View编译失败。Binary XML file line #255: Error inflating ... android动态加载Button 关于游戏中,精灵的移动问题 图片不能正常显示,帮顶也有分 开发中,sdcard路径问题 listview 图片错位问题 求android实现雷达图的demo代码 android原生登录加h5交互 有哪些小伙伴做epub阅读器。
private Context context;
public YourClass(Context context) {
this.context = context;
}
}
只需要通过方法参数把context传过来就行
一般就是xxx页面.this