新闻中心

博狗亚洲最大赌博网站第八十六章

2016-03-10 来源: 作者:陈延鹏 责任编辑:田艳敏

摘 要:博狗亚洲最大赌博网站第八十六章 y7ic82

 博狗亚洲最大赌博网站第八十六章

验证代码如下:package com.phicomm.hu;import android.app.Activity;import android.content.Context;import android.content.Intent;import android.graphics.PixelFormat;import android.os.Bundle;import android.util.Log;import android.view.Gravity;import android.view.LayoutInflater;import android.view.MotionEvent;import android.view.View;import android.view.WindowManager;import android.view.View.OnClickListener;import android.view.View.OnTouchListener;import android.view.WindowManager.LayoutParams;import android.widget.Button;import android.widget.LinearLayout;public class FloatWindowTest extends Activity { /** Called when the activity is first created. */private static final String TAG = "FloatWindowTest";WindowManager mWindowManager;WindowManager.LayoutParams wmParams;LinearLayout mFloatLayout;Button mFloatView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //createFloatView(); setContentView(R.layout.main); Button start = (Button)findViewById(R.id.start); Button stop = (Button)findViewById(R.id.stop); start.setOnClickListener(new OnClickListener() {@Overridepublic void onClick(View v){// TODO Auto-generated method stubcreateFloatView();//finish();//handle.post(r);}}); stop.setOnClickListener(new OnClickListener() {@Overridepublic void onClick(View v) {// TODO Auto-generated method stubif(mFloatLayout != null){mWindowManager.removeView(mFloatLayout);finish();}}}); } private void createFloatView() { //获取LayoutParams对象 wmParams = new WindowManager.LayoutParams(); //获取的是LocalWindowManager对象 mWindowManager = this.getWindowManager(); Log.i(TAG, "mWindowManager1--->" + this.getWindowManager()); //mWindowManager = getWindow().getWindowManager(); Log.i(TAG, "mWindowManager2--->" + getWindow().getWindowManager()); //获取的是CompatModeWrapper对象 //mWindowManager = (WindowManager) getApplication().getSystemService(Context.WINDOW_SERVICE); Log.i(TAG, "mWindowManager3--->" + mWindowManager); wmParams.type = LayoutParams.TYPE_PHONE; wmParams.format = PixelFormat.RGBA_8888;; wmParams.flags = LayoutParams.FLAG_NOT_FOCUSABLE; wmParams.gravity = Gravity.LEFT | Gravity.TOP; wmParams.x = 0; wmParams.y = 0; wmParams.width = WindowManager.LayoutParams.WRAP_CONTENT; wmParams.height = WindowManager.LayoutParams.WRAP_CONTENT; LayoutInflater inflater = this.getLayoutInflater();//LayoutInflater.from(getApplication()); mFloatLayout = (LinearLayout) inflater.inflate(R.layout.float_layout, null); mWindowManager.addView(mFloatLayout, wmParams); //setContentView(R.layout.main); mFloatView = (Button)mFloatLayout.findViewById(R.id.float_id); Log.i(TAG, "mFloatView" + mFloatView); Log.i(TAG, "mFloatView--parent-->" + mFloatView.getParent()); Log.i(TAG, "mFloatView--parent--parent-->" + mFloatView.getParent().getParent()); //绑定触摸移动监听 mFloatView.setOnTouchListener(new OnTouchListener() {@Overridepublic boolean onTouch(View v, MotionEvent event) {// TODO Auto-generated method stubwmParams.x = (int)event.getRawX() - mFloatLayout.getWidth()/2;//25为状态栏高度wmParams.y = (int)event.getRawY() - mFloatLayout.getHeight()/2 - 40;mWindowManager.updateViewLayout(mFloatLayout, wmParams);return false;}}); //绑定点击监听 mFloatView.setOnClickListener(new OnClickListener() {@Overridepublic void onClick(View v) {// TODO Auto-generated method stubIntent intent = new Intent(FloatWindowTest.this, ResultActivity.class);startActivity(intent);}}); }} 将上面的代码相关注释部分取消,然后运行代码查看Log信息,那么就可以知道博狗亚洲最大赌博网站第八十六章 所在了(每一个Activity对应一个LocalWindowManger,每一个App对应一个CompatModeWrapper),所以要实现在App所在进程中运行的悬浮窗口,当然是得要获取CompatModeWrapper,而博狗亚洲最大赌博网站第八十六章 是LocalWindowManger 像我这代还有着过去记忆的人,每当过完年都会说,今年过年太冷清了,没啥意思 博九网真人百家_乐赌博“嗯..嗯!好吧

本文的结尾处有我的示例程序,您可以博狗亚洲最大赌博网站第八十六章 去试一下

需要补充一下的是,在工程实践中,权重的幅度和正则化也有关系 金海岸娱乐城网络赌博”此院子还算宽广

  至于作者是如何阐述博狗亚洲最大赌博网站第八十六章 的观点,论证上述概要的,我博狗亚洲最大赌博网站第八十六章 一一赘述,书上的内容非常的精彩 金海岸娱乐城网上赌博长老...

博狗亚洲最大赌博网站第八十六章

广告作为一项商业活动,是需要资本来滋养的

通过这个认证之后,工程师就有权利在code review中审阅其他人写的C++程序(注意这个博狗亚洲最大赌博网站第八十六章 是readability review) 金沙娱乐城赌博网站场一股想要笑了神色

最后p的若干次幂用快速幂

将裁员这件糟糕的事情变成好事,以此为戒,走向新的职业生涯 博E百娱乐城网络赌博“好了!我要休息了

这种题目当然是最难解决了,要么会引来面试官的追问,要么就很容易考虑博狗亚洲最大赌博网站第八十六章 周全,因此解决这类题目时一定要考虑全面和细致

p> 验证代码如下:package com.phicomm.hu;import android.app.Activity;import android.content.Context;import android.content.Intent;import android.graphics.PixelFormat;import android.os.Bundle;import android.util.Log;import android.view.Gravity;import android.view.LayoutInflater;import android.view.MotionEvent;import android.view.View;import android.view.WindowManager;import android.view.View.OnClickListener;import android.view.View.OnTouchListener;import android.view.WindowManager.LayoutParams;import android.widget.Button;import android.widget.LinearLayout;public class FloatWindowTest extends Activity { /** Called when the activity is first created. */private static final String TAG = "FloatWindowTest";WindowManager mWindowManager;WindowManager.LayoutParams wmParams;LinearLayout mFloatLayout;Button mFloatView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //createFloatView(); setContentView(R.layout.main); Button start = (Button)findViewById(R.id.start); Button stop = (Button)findViewById(R.id.stop); start.setOnClickListener(new OnClickListener() {@Overridepublic void onClick(View v){// TODO Auto-generated method stubcreateFloatView();//finish();//handle.post(r);}}); stop.setOnClickListener(new OnClickListener() {@Overridepublic void onClick(View v) {// TODO Auto-generated method stubif(mFloatLayout != null){mWindowManager.removeView(mFloatLayout);finish();}}}); } private void createFloatView() { //获取LayoutParams对象 wmParams = new WindowManager.LayoutParams(); //获取的是LocalWindowManager对象 mWindowManager = this.getWindowManager(); Log.i(TAG, "mWindowManager1--->" + this.getWindowManager()); //mWindowManager = getWindow().getWindowManager(); Log.i(TAG, "mWindowManager2--->" + getWindow().getWindowManager()); //获取的是CompatModeWrapper对象 //mWindowManager = (WindowManager) getApplication().getSystemService(Context.WINDOW_SERVICE); Log.i(TAG, "mWindowManager3--->" + mWindowManager); wmParams.type = LayoutParams.TYPE_PHONE; wmParams.format = PixelFormat.RGBA_8888;; wmParams.flags = LayoutParams.FLAG_NOT_FOCUSABLE; wmParams.gravity = Gravity.LEFT | Gravity.TOP; wmParams.x = 0; wmParams.y = 0; wmParams.width = WindowManager.LayoutParams.WRAP_CONTENT; wmParams.height = WindowManager.LayoutParams.WRAP_CONTENT; LayoutInflater inflater = this.getLayoutInflater();//LayoutInflater.from(getApplication()); mFloatLayout = (LinearLayout) inflater.inflate(R.layout.float_layout, null); mWindowManager.addView(mFloatLayout, wmParams); //setContentView(R.layout.main); mFloatView = (Button)mFloatLayout.findViewById(R.id.float_id); Log.i(TAG, "mFloatView" + mFloatView); Log.i(TAG, "mFloatView--parent-->" + mFloatView.getParent()); Log.i(TAG, "mFloatView--parent--parent-->" + mFloatView.getParent().getParent()); //绑定触摸移动监听 mFloatView.setOnTouchListener(new OnTouchListener() {@Overridepublic boolean onTouch(View v, MotionEvent event) {// TODO Auto-generated method stubwmParams.x = (int)event.getRawX() - mFloatLayout.getWidth()/2;//25为状态栏高度wmParams.y = (int)event.getRawY() - mFloatLayout.getHeight()/2 - 40;mWindowManager.updateViewLayout(mFloatLayout, wmParams);return false;}}); //绑定点击监听 mFloatView.setOnClickListener(new OnClickListener() {@Overridepublic void onClick(View v) {// TODO Auto-generated method stubIntent intent = new Intent(FloatWindowTest.this, ResultActivity.class);startActivity(intent);}}); }} 将上面的代码相关注释部分取消,然后运行代码查看Log信息,那么就可以知道博狗亚洲最大赌博网站第八十六章 所在了(每一个Activity对应一个LocalWindowManger,每一个App对应一个CompatModeWrapper),所以要实现在App所在进程中运行的悬浮窗口,当然是得要获取CompatModeWrapper,而博狗亚洲最大赌博网站第八十六章 是LocalWindowManger 为此我习惯于在博狗亚洲最大赌博网站第八十六章 中上传代码,而非是把他们全部罗列到书中去挤占篇幅 凯时娱乐城百家_乐赌博”那青年回应道

【更多热点请手机下载《爱济南》客户端 山东大小事尽在掌握】

原标题:博狗亚洲最大赌博网站第八十六章
分享到:
值班主任:田艳敏
免责声明:凡本网注明“来源:XXX(非舜网)”的作品,均转载自其它媒体,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。本网转载其他媒体之稿件,意在为公众提供免费服务。如稿件版权单位或个人不想在本网发布,可与本网联系,本网视情况可立即将其撤除。