当用户想要输入值时,Admob会阻止EditText
。我介绍了这段代码,但它仍然没有用。
iAge = (EditText) v.findViewById(R.id.edAge);
iIncome= (EditText) v.findViewById(R.id.edIncome);
iAge.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View view, boolean hasFocus) {
if (hasFocus) {
mAdView.setVisibility(View.GONE);
} else {
mAdView.setVisibility(View.VISIBLE);
}
}
});
iIncome.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View view, boolean hasFocus) {
if (hasFocus) {
mAdView.setVisibility(View.GONE);
} else {
mAdView.setVisibility(View.VISIBLE);
}
}
});