|
|
@@ -533,6 +533,9 @@ public class MeFragment extends SupportToolBarFragment implements View.OnClickLi
|
|
|
Master master = mList.get(i);
|
|
|
if (master.getMa_user().equals(en_master)) {
|
|
|
master_tv.setText(master.getMa_function());
|
|
|
+ if (adapter!=null) {
|
|
|
+ selectId=i;
|
|
|
+ }
|
|
|
CommonUtil.setSharedPreferences(ct, "Master_ch", master.getMa_function());
|
|
|
}
|
|
|
}
|
|
|
@@ -664,20 +667,21 @@ public class MeFragment extends SupportToolBarFragment implements View.OnClickLi
|
|
|
|
|
|
|
|
|
public PopupWindow popupWindow = null;
|
|
|
- public int selectId;
|
|
|
+ public int selectId=0;
|
|
|
public ItemPopListAdapter adapter;
|
|
|
public void showPopDialog(final Activity ct, List<ItemsSelectType1> itemsSelectType1s){
|
|
|
View view = null;
|
|
|
+ popupWindow=null;
|
|
|
WindowManager windowManager = (WindowManager)ct. getSystemService(Context.WINDOW_SERVICE);
|
|
|
if (popupWindow == null) {
|
|
|
LayoutInflater layoutInflater = (LayoutInflater) ct.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
|
view = layoutInflater.inflate(com.core.app.R.layout.pop_dialog_list, null);
|
|
|
ListView plist = view.findViewById(com.core.app.R.id.mList);
|
|
|
List<ItemsSelectType1> datas =itemsSelectType1s;
|
|
|
- if (adapter==null) {
|
|
|
- adapter = new ItemPopListAdapter(ct, datas);
|
|
|
- }
|
|
|
+ adapter = new ItemPopListAdapter(ct, datas);
|
|
|
+ adapter.setSelectId(selectId);
|
|
|
plist.setAdapter(adapter);
|
|
|
+ plist.setSelection(selectId);
|
|
|
Drawable drawable = ct.getResources().getDrawable(com.core.app.R.drawable.selector_check_items);
|
|
|
plist.setSelector(drawable);
|
|
|
plist.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|