|
|
|
@ -3,9 +3,19 @@ package com.qhclh.ytzh.work.Hatchery; |
|
|
|
import android.support.v7.widget.Toolbar; |
|
|
|
import android.view.View; |
|
|
|
import android.widget.ListView; |
|
|
|
import android.widget.TextView; |
|
|
|
|
|
|
|
import com.qhclh.ytzh.R; |
|
|
|
import com.qhclh.ytzh.base.BaseActivity; |
|
|
|
import com.qhclh.ytzh.home.RpcUrl; |
|
|
|
import com.qhclh.ytzh.tasks.ViewOnClickTask; |
|
|
|
|
|
|
|
import org.forks.jsonrpc.JsonRpcResult; |
|
|
|
import org.forks.jsonrpc.RpcFacade; |
|
|
|
import org.forks.jsonrpc.RpcObject; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import butterknife.BindView; |
|
|
|
|
|
|
|
@ -18,6 +28,9 @@ public class HatcheryActivity extends BaseActivity { |
|
|
|
Toolbar mToolbar; |
|
|
|
@BindView(R.id.lv_hatchery) |
|
|
|
ListView lv_hatchery; |
|
|
|
|
|
|
|
private List<HatcheryBean> list; |
|
|
|
private HatcheryAdapter adapter; |
|
|
|
@Override |
|
|
|
protected int setLayoutId() { |
|
|
|
return R.layout.act_hatchery; |
|
|
|
@ -35,11 +48,40 @@ public class HatcheryActivity extends BaseActivity { |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void initData() { |
|
|
|
|
|
|
|
list = new ArrayList<>(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void initOper() { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void onResume() { |
|
|
|
super.onResume(); |
|
|
|
GetChoiceBoxWords(); |
|
|
|
} |
|
|
|
|
|
|
|
private void GetChoiceBoxWords() { |
|
|
|
ViewOnClickTask hatcheryTask = new ViewOnClickTask(this,"加载中...") { |
|
|
|
List<RpcObject> rpcobj; |
|
|
|
@Override |
|
|
|
protected void successUI() { |
|
|
|
list.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"))); |
|
|
|
} |
|
|
|
adapter = new HatcheryAdapter(HatcheryActivity.this,list); |
|
|
|
lv_hatchery.setAdapter(adapter); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Object call() throws Exception { |
|
|
|
JsonRpcResult result = RpcFacade.rpcCall(RpcUrl.GetChoiceBoxWords,"B3ProduceUnitedInfos_属性是孵化厂的受权限树控制的生产单位","",""); |
|
|
|
rpcobj = result.getRpcObjectList(RpcUrl.GetChoiceBoxWords_fanhui); |
|
|
|
return null; |
|
|
|
} |
|
|
|
}; |
|
|
|
hatcheryTask.execute(); |
|
|
|
} |
|
|
|
} |