public class PopupWindows extends PopupWindow {
@SuppressWarnings("deprecation")
public PopupWindows(Context mContext, View parent) {
final View view = View.inflate(mContext, R.layout.photo_take, null);
view.startAnimation(AnimationUtils.loadAnimation(mContext, R.anim.fade_ins));
setWidth(LayoutParams.FILL_PARENT);
setHeight(LayoutParams.FILL_PARENT);
setBackgroundDrawable(new BitmapDrawable());
setFocusable(true);
setOutsideTouchable(true);
setContentView(view);
showAtLocation(parent, Gravity.BOTTOM, 0, 0);
update();
Button camera = (Button) view.findViewById(R.id.btn_take_photo);
Button photo = (Button) view.findViewById(R.id.btn_pick_photo);
Button cancel = (Button) view.findViewById(R.id.btn_cancel);
view.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
int height = view.findViewById(R.id.pop_layout)
.getTop();
int y = (int) event.getY();
if (event.getAction() == MotionEvent.ACTION_UP) {
if (y < height) {
dismiss();
}
}
return true;
}
});
camera.setOnClickListener(new OnClickListener() {//照相
public void onClick(View v) {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(sdcardTempFile));
startActivityForResult(intent, TAKE_PICTURE);
dismiss();
}
});
photo.setOnClickListener(new OnClickListener() {//相册
public void onClick(View v) {
// 激活系统图库,选择一张图片
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
// 开启一个带有返回值的Activity,请求码为PHOTO_REQUEST_GALLERY
startActivityForResult(intent, RESULT_LOAD_IMAGE);
dismiss();
}
});
cancel.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
dismiss();
}
});
}
}
主活动布局为:
主活动NewspaperRportAddActivity类如下:
public class NewspaperRportAddActivity extends MyBaseActivity implements OnItemClickListener{
private static final int IMG_MAX = 3;
private static final int TAKE_PICTURE = 0;//拍照
private static final int RESULT_LOAD_IMAGE = 1;
private static final int CODE_CROP = 2;//裁剪
protected static final int NEWSPAPERRPORTADDSETDATA = 100;
private EditText naddress;
private EditText ncontent;
//上传图片
private GridView gridview;
private GridAdapter adapter;
private TextView pic;
private HorizontalScrollView selectimg_horizontalScrollView;
private List
用简单的话来定义tcpdump,就是:dump the traffic on a network,根据使用者的定义对网络上的数据包进行截获的包分析工具。 tcpdump可以将网络中传送的数据包的“头”完全截获下来提供分析。它支 持针对网络层、协议、主机、网络或端口的过滤,并提供and、or、not等逻辑语句来帮助你去掉无用的信息。
实用命令实例
默认启动
tcpdump
普通情况下,直
MO= Mobile originate,上行,即用户上发给SP的信息。MT= Mobile Terminate,下行,即SP端下发给用户的信息;
上行:mo提交短信到短信中心下行:mt短信中心向特定的用户转发短信,你的短信是这样的,你所提交的短信,投递的地址是短信中心。短信中心收到你的短信后,存储转发,转发的时候就会根据你填写的接收方号码寻找路由,下发。在彩信领域是一样的道理。下行业务:由SP
import java.util.Arrays;
import java.util.Random;
public class MinKElement {
/**
* 5.最小的K个元素
* I would like to use MaxHeap.
* using QuickSort is also OK
*/
public static void
添加没有默认值:alter table Test add BazaarType char(1)
有默认值的添加列:alter table Test add BazaarType char(1) default(0)
删除没有默认值的列:alter table Test drop COLUMN BazaarType
删除有默认值的列:先删除约束(默认值)alter table Test DRO
Spring Boot 1.2.4已于6.4日发布,repo.spring.io and Maven Central可以下载(推荐使用maven或者gradle构建下载)。
这是一个维护版本,包含了一些修复small number of fixes,建议所有的用户升级。
Spring Boot 1.3的第一个里程碑版本将在几天后发布,包含许多