public void showPopup(View view) {
//popup ekranı için 1 adet layout oluşturduk
final View popupView = getLayoutInflater().inflate(R.layout.custom_popup_stock_detail, null);
final PopupWindow popupWindow = new PopupWindow(popupView,
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
TextView tvStockName = (TextView) popupView.findViewById(R.id.tvStockName);
ImageButton ibNegative=(ImageButton)popupView.findViewById(R.id.ibNegative);
tvStockName.setText(stockName);
ibNegative.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
popupWindow.dismiss();
}
});
//popup konum ayarlaması
popupWindow.setFocusable(true);
popupWindow.setBackgroundDrawable(new ColorDrawable());
int location[] = new int[2];
view.getLocationOnScreen(location);
popupWindow.showAtLocation(view, Gravity.CENTER, 0, 0);
}