【Android_View_得到Activity】笛里谁知壮士心,沙头空照征人骨。这篇文章主要讲述Android_View_得到Activity相关的知识,希望能为你提供帮助。
Context context = view.getContext(); if (context instanceof Activity){ Activity activity = (Activity)context; }
//应用 public View.OnClickListener onClickListener = new View.OnClickListener() { public void onClick(View v) { Activity currentActivity = (Activity) v.getContext(); Intent i = new Intent(currentActivity, ScreenTransitionLab.class); currentActivity.startActivity(i); } };
推荐阅读
- Android SVG动画PathView源代码解析与使用教程(API 14)
- extract-text-webpack-plugin(you may need an appropriate loader to handle this file type)
- 广州货拉拉货系统app开发
- Android Device Monitor 导出文件错误
- Android百分比布局
- Android IPC机制:浅谈Binder的使用
- Android 异常: failed to connect to localhost/127.0.0.1
- AppiumAPI(常用)
- Android--使用XMLPull解析xml