popupwindow的使用 :
public void onItemClick(AdapterView<?> parent, View view, int position,long id) {
/************************** 屏幕适配 ************************************/
int popupWindowWidth = Integer.valueOf(getResources().getString(R.string.popwindowwidth).toString().trim());
int popupWindowHeight = Integer.valueOf(getResources().getString(R.string.popwindowheight).toString().trim());
int dx = Integer.valueOf(getResources().getString(R.string.popwindowdx).toString().trim());
/**********************************************************************/
int[] location = new int[2];
view.getLocationInWindow(location);
int x = location[0] + dx;
int y = location[1];
AppInfo info = (AppInfo) lv_AppManagerAcitivty.getItemAtPosition(position);
View popupWindow = View.inflate(this, R.layout.popwindow, null);
ll_start = (LinearLayout) popupWindow.findViewById(R.id.ll_start);
ll_uninstall = (LinearLayout) popupWindow.findViewById(R.id.ll_uninstall);
ll_share = (LinearLayout) popupWindow.findViewById(R.id.ll_share);
ll_start.setTag(position);
ll_uninstall.setTag(position);
ll_share.setTag(position);
ll_start.setOnClickListener(this);
ll_uninstall.setOnClickListener(this);
ll_share.setOnClickListener(this);
localPopupWindow = new PopupWindow(popupWindow, popupWindowWidth,popupWindowHeight);
Drawable background = getResources().getDrawable(R.drawable.local_popup_bg);
//注意:popwindow一定要设置背景
localPopupWindow.setBackgroundDrawable(background);
localPopupWindow.showAtLocation(view, Gravity.LEFT | Gravity.TOP, x, y);
}