Fix an issue with popup definition coming after vector calls
This commit is contained in:
parent
5485f2f16e
commit
89ab2420c9
|
@ -44,8 +44,6 @@ public class GL2JNIActivity extends Activity {
|
|||
|
||||
public static HashMap<Integer, String> deviceId_deviceDescriptor = new HashMap<Integer, String>();
|
||||
public static HashMap<String, Integer> deviceDescriptor_PlayerNum = new HashMap<String, Integer>();
|
||||
|
||||
private Vector<PopupWindow> popups = new Vector<PopupWindow>();
|
||||
|
||||
int map[][];
|
||||
|
||||
|
@ -58,7 +56,7 @@ public class GL2JNIActivity extends Activity {
|
|||
|
||||
prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
ConfigureFragment.getCurrentConfiguration(prefs);
|
||||
menu = new OnScreenMenu(GL2JNIActivity.this, prefs, popups);
|
||||
menu = new OnScreenMenu(GL2JNIActivity.this, prefs);
|
||||
popUp = menu.createPopup();
|
||||
/*
|
||||
* try { //int rID =
|
||||
|
@ -566,12 +564,7 @@ public class GL2JNIActivity extends Activity {
|
|||
if (!popUp.isShowing()) {
|
||||
displayPopUp(popUp);
|
||||
} else {
|
||||
for (PopupWindow popup : popups) {
|
||||
if (popup.isShowing()) {
|
||||
popup.dismiss();
|
||||
popups.remove(popup);
|
||||
}
|
||||
}
|
||||
menu.dismissPopUps();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -35,10 +35,11 @@ public class OnScreenMenu {
|
|||
private File sdcard = Environment.getExternalStorageDirectory();
|
||||
private String home_directory = sdcard + "/dc";
|
||||
|
||||
public OnScreenMenu(Context mContext, SharedPreferences prefs, Vector<PopupWindow> popups) {
|
||||
public OnScreenMenu(Context mContext, SharedPreferences prefs) {
|
||||
if (mContext instanceof GL2JNIActivity) {
|
||||
this.mContext = (GL2JNIActivity) mContext;
|
||||
}
|
||||
popups = new Vector<PopupWindow>();
|
||||
if (prefs != null) {
|
||||
this.prefs = prefs;
|
||||
home_directory = prefs.getString("home_directory", home_directory);
|
||||
|
@ -308,4 +309,13 @@ public class OnScreenMenu {
|
|||
|
||||
return but;
|
||||
}
|
||||
|
||||
public void dismissPopUps() {
|
||||
for (PopupWindow popup : popups) {
|
||||
if (popup.isShowing()) {
|
||||
popup.dismiss();
|
||||
popups.remove(popup);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue