0
アクティビティAから表示されているポップアップウィンドウです。アクティビティAのボタンを押すとアクティビティBが表示されます。しかし、問題は、私が上に常にあることをポップアップ表示アクティビティがバックグラウンドになっていてもアクティビティがバックグラウンドに戻り、新しいアクティビティが戻ってきても、Androidポップアップウィンドウを常に上に保ちます。
LayoutInflater layoutInflater = (LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE);
LeadOffPopView = layoutInflater.inflate(
R.layout.leadoffdetect, null);
LeadOffPopWindow = new PopupWindow(
LeadOffPopView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
final TextView bLATxtVw = (TextView) (LeadOffPopView)
.findViewById(R.id.LATxtVw);
final TextView bRATextView = (TextView) (LeadOffPopView)
.findViewById(R.id.RATxtVw);
final TextView bLLTextView = (TextView) (LeadOffPopView)
.findViewById(R.id.LLTxtVw);
final TextView bRLTextView = (TextView) (LeadOffPopView)
.findViewById(R.id.RLTxtVw);
final TextView bV1TextView = (TextView) (LeadOffPopView)
.findViewById(R.id.V1TxtVw);
final TextView bV2TextView = (TextView) (LeadOffPopView)
.findViewById(R.id.V2TxtVw);
final TextView bV3TextView = (TextView) (LeadOffPopView)
.findViewById(R.id.V3TxtVw);
final TextView bV4TextView = (TextView) (LeadOffPopView)
.findViewById(R.id.V4TxtVw);
final TextView bV5TextView = (TextView) (LeadOffPopView)
.findViewById(R.id.V5TxtVw);
final TextView bV6TextView = (TextView) (LeadOffPopView)
.findViewById(R.id.V6TxtVw);
final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
if (bLAOff) {
bLATxtVw.setVisibility(View.VISIBLE);
} else
bRATextView
.setVisibility(View.INVISIBLE);
if (bRAOff) {
bRATextView
.setVisibility(View.VISIBLE);
} else
bRATextView
.setVisibility(View.INVISIBLE);
if (bLLOff) {
bLLTextView
.setVisibility(View.VISIBLE);
} else
bLLTextView
.setVisibility(View.INVISIBLE);
if (bRLOff) {
bRLTextView
.setVisibility(View.VISIBLE);
} else
bRLTextView
.setVisibility(View.INVISIBLE);
if (bV1Off) {
if(!MainClass.bLANDSCAPEENABLED)
bV1TextView
.setVisibility(View.VISIBLE);
} else
bV1TextView
.setVisibility(View.INVISIBLE);
if (bV2Off) {
if(!MainClass.bLANDSCAPEENABLED)
bV2TextView
.setVisibility(View.VISIBLE);
} else
bV2TextView
.setVisibility(View.INVISIBLE);
if (bV3Off) {
if(!MainClass.bLANDSCAPEENABLED)
bV3TextView
.setVisibility(View.VISIBLE);
} else
bV3TextView
.setVisibility(View.INVISIBLE);
if (bV4Off) {
if(!MainClass.bLANDSCAPEENABLED)
bV4TextView
.setVisibility(View.VISIBLE);
} else
bV4TextView
.setVisibility(View.INVISIBLE);
if (bV5Off) {
if(!MainClass.bLANDSCAPEENABLED)
bV5TextView
.setVisibility(View.VISIBLE);
} else
bV5TextView
.setVisibility(View.INVISIBLE);
if (bV6Off) {
if(!MainClass.bLANDSCAPEENABLED)
bV6TextView
.setVisibility(View.VISIBLE);
} else
bV6TextView
.setVisibility(View.INVISIBLE);
handler.postDelayed(this, 500);
}
}, 250);
LeadOffPopWindow.showAtLocation(
LeadOffPopView,
Gravity.CENTER_HORIZONTAL | Gravity.TOP,20 ,
300);