|
|
|
@ -1,10 +1,12 @@ |
|
|
|
package com.qhclh.ytzh.work.Fowl; |
|
|
|
|
|
|
|
import android.content.DialogInterface; |
|
|
|
import android.support.design.widget.TabLayout; |
|
|
|
import android.support.v4.app.Fragment; |
|
|
|
import android.support.v4.app.FragmentManager; |
|
|
|
import android.support.v4.app.FragmentPagerAdapter; |
|
|
|
import android.support.v4.view.ViewPager; |
|
|
|
import android.support.v7.app.AlertDialog; |
|
|
|
import android.support.v7.widget.Toolbar; |
|
|
|
import android.view.Menu; |
|
|
|
import android.view.MenuItem; |
|
|
|
@ -45,6 +47,8 @@ public class FowlActivity extends BaseActivity { |
|
|
|
private TabViewPagerAdapter mViewPagerAdapter; |
|
|
|
|
|
|
|
private List<HatcheryBean> list; |
|
|
|
private List<Long> pianquid; |
|
|
|
private List<String> pianquname; |
|
|
|
@Override |
|
|
|
protected int setLayoutId() { |
|
|
|
return R.layout.act_poultrydailyreport; |
|
|
|
@ -65,6 +69,8 @@ public class FowlActivity extends BaseActivity { |
|
|
|
@Override |
|
|
|
protected void initData() { |
|
|
|
list = new ArrayList<>(); |
|
|
|
pianquid = new ArrayList<>(); |
|
|
|
pianquname = new ArrayList<>(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@ -95,9 +101,33 @@ public class FowlActivity extends BaseActivity { |
|
|
|
@Override |
|
|
|
protected void successUI() { |
|
|
|
list.clear(); |
|
|
|
pianquid.clear(); |
|
|
|
pianquname.clear(); |
|
|
|
for (int i =0;i<rpcobj.size();i++){ |
|
|
|
list.add(new HatcheryBean(Long.parseLong(rpcobj.get(i).getString("Item1")),rpcobj.get(i).getString("Item2").substring(1))); |
|
|
|
pianquid.add(Long.parseLong(rpcobj.get(i).getString("Item1"))); |
|
|
|
pianquname.add(rpcobj.get(i).getString("Item2").substring(1)); |
|
|
|
} |
|
|
|
|
|
|
|
final String items[] = pianquname.toArray(new String[pianquname.size()]); |
|
|
|
new AlertDialog.Builder(FowlActivity.this) |
|
|
|
.setTitle("请选择片区") |
|
|
|
.setIcon(R.mipmap.ic_launcher) |
|
|
|
.setSingleChoiceItems(items, 0, |
|
|
|
new DialogInterface.OnClickListener() { |
|
|
|
public void onClick(DialogInterface dialog, int which) { |
|
|
|
tv_toolbar_title.setText(items[which]); |
|
|
|
dialog.dismiss(); |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
.setNegativeButton("取消", new DialogInterface.OnClickListener() { |
|
|
|
@Override |
|
|
|
public void onClick(DialogInterface dialogInterface, int i) { |
|
|
|
dialogInterface.dismiss(); |
|
|
|
} |
|
|
|
}) |
|
|
|
.show(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
|