I have an idea EditText,
<EditText
android:layout_weight="1"
android:id="@+id/etMiktar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/miktarHint"
android:focusable="false">
</EditText>
And I implemented a popup that opens when the user touches this kind of EditText. There is a button in this popup, so when clicked, the popup should be fired. Although it gets my clicks, the popup does not close. Here is my popup implementation:
private void inflatePopUpSiparis(){
LayoutInflater inflater = (LayoutInflater)
this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final PopupWindow pwSiparis = new PopupWindow(inflater.inflate(R.layout.siparismiktarpopup, null, false),400,550,true);
pwSiparis.showAtLocation(this.findViewById(R.id.llMain), Gravity.CENTER, 0, 0);
View myPopUpSiparisView = pwSiparis.getContentView();
etSiparisMiktar=(EditText)myPopUpSiparisView.findViewById(R.id.etSiparisMiktar);
etSiparisMiktar.setText(etUrunMiktar.getText().toString());
btnPopUpSiparisTamam=(Button)myPopUpSiparisView.findViewById(R.id.btnPopUpSiparis);
btnPopUpSiparisTamam.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
pwSiparis.dismiss();
Log.d("****",etSiparisMiktar.getText().toString().toString());
etUrunMiktar.setText(etSiparisMiktar.getText().toString());
}
});
}
}
What could be the problem?
source
share