android和js相互调用

1.这个html页面必须放在android项目中的assets里,Android SDK提供了一个schema前缀为"file:///android_asset/".WebView遇到这样的schema,就去当前包中的 assets目录中找内容.如:"file:///android_asset/demo.html" 

</pre><pre name="code" class="html"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>

.select { width:120px; height:24px; background:none; border:none; margin:-2px; padding-right: -20px; margin-right:-20px; }
.sleHid { display:block; width:100px; overflow:hidden; }

.select_hy { width:200px; height:24px; background:none; border:none; margin:-2px; padding-right: -20px; margin-right:-20px; }
.sleHid_hy { display:block; width:180px; overflow:hidden; }

</style>
<script>

	function myselect(arg1,arg2,arg3,arg4){
		var obj_value = document.getElementById(arg1).innerHTML; //隐藏值
		var obj_show = document.getElementById(arg1+"show").innerHTML; //显示值
		var str = eval("("+arg4+")");
		for(var i = 0 ; i < str.length ; i++){
			if(str[i].keyValue == obj_value) {
				str[i].keySelected ="true";
			} 
      	} 
		eval("var json = '"+JSON.stringify(str)+"';");//解决中文乱码是unicode问题
		window.demo.js4WenBenBianJiGeRen(json);
	}
	function addinput(arg1){
	 document.getElementById("guojia").value=arg1;
	}
	/**我的input
	 ** arg1 ID 
	 ** arg2 标题
	 ** arg3 type
	 **/
	function myinput(arg1,arg2,arg3){
		if(myobjload == "1"){return;}
		var tempvalue = document.getElementById(arg1).innerHTML;
		window.js4Impl.js4WenBenBianJiGeRen(arg1,arg2,arg3,tempvalue);
	}
	//我的checkbox(){
	function mycheckbox(arg1,arg2,arg3,arg4){
		if(myobjload == "1"){return;}
		var obj_value = document.getElementById(arg1).innerHTML; //隐藏值
		var obj_show = document.getElementById(arg1+"_show").innerHTML; //显示值
		var str = eval("("+arg4+")");
		var temp_value = str.duoxuanid;
		var temp_name = str.duoxuanname;
		var temp_check = str.duoxuanstate;
		for(var i = 0 ; i < temp_value.length ; i++){
			var myitem = obj_value.split(",");
			for(var j = 0 ; j < myitem.length ; j++){
				if(temp_value[i] == myitem[j]) {
					temp_check[i] ="true";
				}
			}	
      	} 
		eval("var json = '"+JSON.stringify(str)+"';");//解决中文乱码是unicode问题
		window.demo.js4WenBenBianJiGeRen(json);
	}
	/**赋值方法
	 ** arg1 ID 
	 ** arg2 value
	 ** arg3 type
	 **/
	function myloadinput(arg1,arg2,type){
	
		if(type == 'select'){
		
			if(arg2!=null && ""!=arg2){
				var tempitem = arg2.split(",");
				document.getElementById(arg1+"show").innerHTML=tempitem[0];
				document.getElementById(arg1).innerHTML=tempitem[1];
			}
			
		}
		
		if(type == 'checkbox'){
			var temp_show = "";
			var temp_hidden = "";
			if(arg2!=null && ""!=arg2){
				var tempitem = arg2.split("|");
				for(var i = 0 ; i < tempitem.length ; i++){
					var temp_str = tempitem[i].split(",");
					temp_show += temp_str[0]+"、";
					temp_hidden += temp_str[1]+",";
				}
				if(temp_hidden!=null && ""!=temp_hidden){
					temp_hidden = temp_hidden.substr(0,temp_hidden.length-1);
				}
				if(temp_show!=null && ""!=temp_show){
					temp_show = temp_show.substr(0,temp_show.length-1);
				}
				document.getElementById(arg1+"show").innerHTML=temp_show;
				document.getElementById(arg1).innerHTML=temp_hidden;
			}
		}
		
		if(type == 'input'){
			document.getElementById(arg1).innerHTML = arg2;
		}
		
		if(type == 'number'){
			document.getElementById(arg1).innerHTML = arg2;
		}
		
		if(type == 'textarea'){
			document.getElementById(arg1).innerHTML = arg2;
		}
	}
	
	/**
	 * 赋展现值方法
	 * arg1 当前ID
	 * arg2 当前值
	 * arg3 json
	 **/
	function myloadviewtext(arg1,arg2,arg3){
		var tempobj = document.getElementById(arg1+"show"); 
		if(tempobj != null ){ 
			var str = eval("("+arg3+")");
				for(var i = 0 ; i < str.length ; i++){
					 if(str[i].keyValue == arg2){
						tempobj.innerHTML = str[i].keyName;
					 }
				}
			} 
	}
	
	
	function gettime(arg){
		window.js4Impl.js4gettime(arg);
	}
	
	function setmytime(argid,argvalue){
		var temp = document.getElementById(argid);
		if(temp != null){
			temp.innerHTML = argvalue;
		}
	}

	function deletetime(){

		var shiXiaoRiQiWu = document.getElementById("shiXiaoRiQiWu");
		if(shiXiaoRiQiWu.checked==true){
			var time = document.getElementById("shiXiaoRiQi");
			time.innerHTML = "";
		}	
	}
    //调用安卓的端的程序
    function testDemo(){
      var str=window.demo.getinfo();
      document.getElementById("tid").innerHTML=str;
    }

</script>
</head>

<body>
<form id="myform" name="myform" >
<table width="100%" border="0" cellpadding="10" cellspacing="1" bgcolor="#BBBBBB" >
  <tr>
     <td colspan="2" align="center" ><font style="font-size:17px">个人客户证件信息表</font></td>
  </tr>
  <tr>
    <td width="50%" bgcolor="#FFFFFF"><table width="100%" border="0">
      <tr>
        <td width="40%">证件类型</td>
        <td id="jjr" style="border:1px #BBBBBB solid;" 
			οnclick=myselect("zhengJianLeiXing","证件类型","select","[{\"keyName\":\"身份证\",\"keyValue\":\"身份证\",\"keySelected\":\"false\"},{\"keyName\":\"户口簿\",\"keyValue\":\"户口簿\",\"keySelected\":\"false\"},{\"keyName\":\"护照\",\"keyValue\":\"护照\",\"keySelected\":\"false\"},{\"keyName\":\"军官证\",\"keyValue\":\"军官证\",\"keySelected\":\"false\"},{\"keyName\":\"士兵证\",\"keyValue\":\"士兵证\",\"keySelected\":\"false\"},{\"keyName\":\"警官证\",\"keyValue\":\"警官证\",\"keySelected\":\"false\"},{\"keyName\":\"港澳居民来往内地通行证\",\"keyValue\":\"港澳居民来往内地通行证\",\"keySelected\":\"false\"},{\"keyName\":\"台湾同胞来往内地通行证\",\"keyValue\":\"台湾同胞来往内地通行证\",\"keySelected\":\"false\"},{\"keyName\":\"外国人居留证\",\"keyValue\":\"外国人居留证\",\"keySelected\":\"false\"},{\"keyName\":\"社会保障证\",\"keyValue\":\"社会保障证\",\"keySelected\":\"false\"},{\"keyName\":\"个人纳税证\",\"keyValue\":\"个人纳税证\",\"keySelected\":\"false\"},{\"keyName\":\"个人其它证件\",\"keyValue\":\"个人其它证件\",\"keySelected\":\"false\"},{\"keyName\":\"注册登记证\",\"keyValue\":\"注册登记证\",\"keySelected\":\"false\"},{\"keyName\":\"营业执照\",\"keyValue\":\"营业执照\",\"keySelected\":\"false\"},{\"keyName\":\"组织机构代码证\",\"keyValue\":\"组织机构代码证\",\"keySelected\":\"false\"},{\"keyName\":\"外貿许可证\",\"keyValue\":\"外貿许可证\",\"keySelected\":\"false\"},{\"keyName\":\"开户许可证\",\"keyValue\":\"开户许可证\",\"keySelected\":\"false\"},{\"keyName\":\"特种行业许可证\",\"keyValue\":\"特种行业许可证\",\"keySelected\":\"false\"},{\"keyName\":\"外汇经营许可证\",\"keyValue\":\"外汇经营许可证\",\"keySelected\":\"false\"},{\"keyName\":\"金融经营许可证\",\"keyValue\":\"金融经营许可证\",\"keySelected\":\"false\"},{\"keyName\":\"国税登记证\",\"keyValue\":\"国税登记证\",\"keySelected\":\"false\"},{\"keyName\":\"地税登记证\",\"keyValue\":\"地税登记证\",\"keySelected\":\"false\"},{\"keyName\":\"批文\",\"keyValue\":\"批文\",\"keySelected\":\"false\"},{\"keyName\":\"贷款证\",\"keyValue\":\"贷款证\",\"keySelected\":\"false\"},{\"keyName\":\"公司其他证件\",\"keyValue\":\"公司其他证件\",\"keySelected\":\"false\"},{\"keyName\":\"学生证\",\"keyValue\":\"学生证\",\"keySelected\":\"false\"},{\"keyName\":\"驾驶证\",\"keyValue\":\"驾驶证\",\"keySelected\":\"false\"}]") ><label >
			<myshow name="zhengJianLeiXingshow" id="zhengJianLeiXingshow">身份证</myshow>
			<myobj name="zhengJianLeiXing" id="zhengJianLeiXing" style="display:none;">身份证</myobj>
        </label></td>
      </tr>
    </table></td>
    <td bgcolor="#FFFFFF"><table width="100%" border="0">
      <tr>
        <td width="40%">证件上名称</td>
        <td id="tid" style="border:1px #BBBBBB solid;" 
			οnclick="testDemo()"><label>
          <myobj name="zhengJianShangMingCheng" id="zhengJianShangMingCheng"></myobj>
        </label></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><table width="100%" border="0">
      <tr>
        <td width="40%">证件号码</td>
        <td>
        <input type="text" name="englishName" id="englishName" title="客户号" onClick="selText(this)"/>
        </td>
      </tr>
    </table></td>
    <td bgcolor="#FFFFFF"><table width="100%" border="0">
      <tr>
        <td width="40%">年检标识</td>
        <td style="border:1px #BBBBBB solid;" 
			οnclick=myselect("nianJianBiaoShi","年检标识","select","[{\"keyName\":\"正常年检\",\"keyValue\":\"正常年检\",\"keySelected\":\"false\"},{\"keyName\":\"未年检\",\"keyValue\":\"未年检\",\"keySelected\":\"false\"},{\"keyName\":\"吊销\",\"keyValue\":\"吊销\",\"keySelected\":\"false\"},{\"keyName\":\"注销\",\"keyValue\":\"注销\",\"keySelected\":\"false\"}]") ><label>
			<myshow name="nianJianBiaoShishow" id="nianJianBiaoShishow"></myshow>
			<myobj name="nianJianBiaoShi" id="nianJianBiaoShi" style="display:none;"></myobj>
        </label></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><table width="100%" border="0">
      <tr>
        <td width="40%">签发国家</td>
        <td>
        <input type="text" value="" id="guojia">
        </td>
      </tr>
    </table></td>
    <td bgcolor="#FFFFFF"><table width="100%" border="0">
      <tr>
        <td width="40%">签发机构</td>
        <td style="border:1px #BBBBBB solid;" 
			οnclick="myinput('qianFaJiGou','签发机构','input')"><label>
          <myobj name="qianFaJiGou" id="qianFaJiGou">桐庐县公安局</myobj>
        </label></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><table width="100%" border="0">
      <tr>
        <td width="40%">签发日期</td>
        <td style="border:1px #BBBBBB solid;" οnclick="gettime('qianFaRiQi')" ><label>
          <myobj name="qianFaRiQi" id="qianFaRiQi"></myobj>
        </label></td>
      </tr>
    </table></td>
    <td bgcolor="#FFFFFF"><table width="100%" border="0">
      <tr>
        <td width="40%">失效日期</td>
        <td style="border:1px #BBBBBB solid;" οnclick="gettime('shiXiaoRiQi')" ><label>
          <myobj name="shiXiaoRiQi" id="shiXiaoRiQi"></myobj>
        </label></td>
		<td style="border:1px #BBBBBB solid;"  width="10%" >
			<label><input type="checkbox" name="checktime" οnclick="deletetime()"  id="shiXiaoRiQiWu" />无</label>
        </td>
      </tr>
    </table></td>
  </tr>
</table>
<table height="330px"></table>
</form>
</body>
</html>
2.这是AlertDialog的LinearLayout,里面有几个图片没有上传(有兴趣的人可以自己添加)
<pre name="code" class="java"><?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_vertical"
    android:background="@drawable/popbg"
    android:orientation="vertical"  >
    <LinearLayout 
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="6dp"
        android:layout_marginRight="6dp"
        android:background="@drawable/windows_title"
        android:gravity="center"
        >
       <ImageView 
            android:id="@+id/btn_cha"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="0.1"
           />
       <TextView 
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:textStyle="bold"
           android:gravity="center"
           android:textSize="18sp"
           android:layout_weight="1"
           android:text="下拉编辑框"
           />
          <ImageView
            android:id="@+id/btn_jsxialawenben_tuichu"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="0.1"
            android:src="@drawable/cha" />
    </LinearLayout>
 <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_margin="20dp"
        android:background="#FFFFFF"
        android:orientation="vertical" >

        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="center_vertical"
            android:orientation="horizontal"
            android:padding="10dp" >

            <TextView
                android:id="@+id/jsxialawenben_title1"
                android:layout_width="200dp"
                android:layout_height="wrap_content"
                android:gravity="left"
                android:text="标题"
                android:textSize="16sp"
                android:textStyle="bold" />
				<Spinner
                    android:id="@+id/jsxialawenben_spinner"
                    android:layout_width="320dp"
                    android:layout_height="wrap_content"
                    android:layout_toRightOf="@id/jsxialawenben_title1"
                    android:background="@drawable/spinner_01"
                    />

				<ImageView
				    android:id="@+id/imageView1"
				    android:layout_width="wrap_content"
				    android:layout_height="wrap_content"
				    android:layout_alignRight="@+id/jsxialawenben_spinner"
				    android:layout_centerVertical="true"
				    android:src="@drawable/spinner_02" />

        </RelativeLayout>

         <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="150dp"
        android:layout_marginTop="20dp"
        android:gravity="center"
        android:orientation="horizontal" >

        <Button
        android:id="@+id/bt_jsxialawenben_queding"
        android:layout_width="150dp"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonbg_btn"
        android:text="确定"
        android:textColor="#FFFFFF"
        android:textSize="16sp" />
            
        </LinearLayout>
    </LinearLayout>
</LinearLayout>
3.main_layout.xml
 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity" >
    <WebView 
        android:id="@+id/webview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        />
</RelativeLayout>
4.<span style="font-family: Arial, Helvetica, sans-serif;">MainActivity </span>
@SuppressLint("JavascriptInterface")
public class MainActivity extends Activity {


<span style="white-space:pre">	</span>private WebView mwebView;
<span style="white-space:pre">	</span>private Spinner spinner;
<span style="white-space:pre">	</span>@Override
<span style="white-space:pre">	</span>protected void onCreate(Bundle savedInstanceState) {
<span style="white-space:pre">		</span>super.onCreate(savedInstanceState);
<span style="white-space:pre">		</span>setContentView(R.layout.activity_main);
<span style="white-space:pre">		</span>mwebView=(WebView) findViewById(R.id.webview);
<span style="white-space:pre">		</span>WebSettings webSettings =mwebView.getSettings();
<span style="white-space:pre">		</span>webSettings.setSavePassword(false);
<span style="white-space:pre">		</span>webSettings.setSaveFormData(false);
<span style="white-space:pre">		</span>webSettings.setJavaScriptEnabled(true);
<span style="white-space:pre">		</span>webSettings.setSupportZoom(false);
        webSettings.setDefaultTextEncodingName("utf-8");
<span style="white-space:pre">		</span>webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
<span style="white-space:pre">		</span>mwebView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
<span style="white-space:pre">		</span>webSettings.setJavaScriptEnabled(true);
<span style="white-space:pre">	</span>    mwebView.addJavascriptInterface(new callbank(),"demo");
<span style="white-space:pre">		</span>mwebView.loadUrl("file:///android_asset/geren-zhengjianxinxi.html");
<span style="white-space:pre">		</span>mwebView.loadUrl("javascript:test('aa')");
<span style="white-space:pre">		</span>mwebView.setWebViewClient(new WebViewClient(){
<span style="white-space:pre">		</span>  @Override
<span style="white-space:pre">		</span>public void onPageFinished(WebView view, String url) {
<span style="white-space:pre">			</span>// TODO Auto-generated method stub
<span style="white-space:pre">			</span>super.onPageFinished(view, url);
<span style="white-space:pre">		</span>   }
<span style="white-space:pre">		</span>  @Override
<span style="white-space:pre">			</span>public void onReceivedError(WebView view, int errorCode,
<span style="white-space:pre">					</span>String description, String failingUrl) {
<span style="white-space:pre">				</span>super.onReceivedError(view, errorCode, description, failingUrl);
<span style="white-space:pre">			</span>}
<span style="white-space:pre">		</span> 
<span style="white-space:pre">		</span>});
<span style="white-space:pre">		</span>mwebView.setWebChromeClient(new WebChromeClient(){
<span style="white-space:pre">			</span>@Override
<span style="white-space:pre">			</span>public boolean onJsBeforeUnload(WebView view, String url,
<span style="white-space:pre">					</span>String message, JsResult result) {
<span style="white-space:pre">				</span>// TODO Auto-generated method stub
<span style="white-space:pre">				</span>return super.onJsBeforeUnload(view, url, message, result);
<span style="white-space:pre">			</span>}
<span style="white-space:pre">		</span> @Override
<span style="white-space:pre">		</span>public boolean onJsAlert(WebView view, String url, String message,
<span style="white-space:pre">				</span>JsResult result) {
<span style="white-space:pre">			</span>return super.onJsAlert(view, url, message, result);
<span style="white-space:pre">		</span>}
<span style="white-space:pre">		</span> 
<span style="white-space:pre">		</span>});
<span style="white-space:pre">	</span>}
<span style="white-space:pre">	</span>
   public Handler mHandler=new Handler(){
<span style="white-space:pre">	</span>   
   };
   
   
   /**
    * js调用android的代码
    * @author admin
    */
   public class callbank{
<span style="white-space:pre">	</span>   String info;
<span style="white-space:pre">	</span>   public String getinfo(){
<span style="white-space:pre">		</span>   return "jjr success";
<span style="white-space:pre">	</span>   }
<span style="white-space:pre">	</span>   public void js4WenBenBianJiGeRen(String json){
<span style="white-space:pre">		</span>  final AlertDialog builder=new AlertDialog.Builder(MainActivity.this).show();
<span style="white-space:pre">		</span>  builder.setContentView(R.layout.js_bianji);
<span style="white-space:pre">		</span>  spinner=(Spinner) builder.findViewById(R.id.jsxialawenben_spinner);
<span style="white-space:pre">		</span>  final JsSpinnerBean[] JsonResponse = (JsSpinnerBean[])json2Obj(JsSpinnerBean[].class,json);
<span style="white-space:pre">		</span>  String[] strkeys=new String[JsonResponse.length];// 显示值
<span style="white-space:pre">		</span>  for(int i=0,len=strkeys.length;i<len;i++){
<span style="white-space:pre">			</span>  strkeys[i]=JsonResponse[i].getKeyName();
<span style="white-space:pre">		</span>  }
<span style="white-space:pre">		</span>  ArrayAdapter<String> adapter=new ArrayAdapter<String>(MainActivity.this,android.R.layout.simple_spinner_item,
<span style="white-space:pre">				</span>  strkeys);
<span style="white-space:pre">		</span>  adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
<span style="white-space:pre">		</span>  spinner.setAdapter(adapter);<span style="white-space:pre">	</span>
<span style="white-space:pre">		</span>  Button btnok=(Button) builder.findViewById(R.id.bt_jsxialawenben_queding);
<span style="white-space:pre">		</span>  spinner.setOnItemSelectedListener(new OnItemSelectedListener() {


<span style="white-space:pre">			</span>@Override
<span style="white-space:pre">			</span>public void onItemSelected(AdapterView<?> adapter, View view,
<span style="white-space:pre">					</span>int position, long id) {
<span style="white-space:pre">				</span>info=(String) adapter.getAdapter().getItem(position);
<span style="white-space:pre">			</span>}


<span style="white-space:pre">			</span>@Override
<span style="white-space:pre">			</span>public void onNothingSelected(AdapterView<?> arg0) {
<span style="white-space:pre">				</span>
<span style="white-space:pre">			</span>}
<span style="white-space:pre">		</span>   });
<span style="white-space:pre">		</span>  btnok.setOnClickListener(new OnClickListener() {
<span style="white-space:pre">			</span>
<span style="white-space:pre">			</span>@Override
<span style="white-space:pre">			</span>public void onClick(View view) {
<span style="white-space:pre">				</span>builder.dismiss();
<span style="white-space:pre">				</span>mwebView.loadUrl("javascript:addinput('"+info+"')");
<span style="white-space:pre">			</span>}
<span style="white-space:pre">		</span>});
<span style="white-space:pre">	</span>   }
   }
   
<span style="white-space:pre">	</span>@Override
<span style="white-space:pre">	</span>public boolean onCreateOptionsMenu(Menu menu) {
<span style="white-space:pre">		</span>// Inflate the menu; this adds items to the action bar if it is present.
<span style="white-space:pre">		</span>getMenuInflater().inflate(R.menu.main, menu);
<span style="white-space:pre">		</span>return true;
<span style="white-space:pre">	</span>}
<span style="white-space:pre">	</span> /**
     * 将json格式的数据转化为对象,主要采用的是google 的gson jar包的功能
     * 
     * @param jsonclass
     * @param json
     * @return
     */
    public static Object json2Obj(Class jsonclass, String json){


        Object obj = null;
        GsonBuilder gsonBuilder = new GsonBuilder();


        Gson gson = gsonBuilder.create();
        try
        {


            obj = gson.fromJson(json, jsonclass);


        }
        catch(JsonParseException e)
        {


            e.printStackTrace();
            obj = ParserJSONManual(jsonclass, json);
            return obj;
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }


        return obj;


    }
    /**
     * 手动解析的方法 不定结构的类型都放在该方法中手动解析成JSONObject
     * 
     * @throws JSONException
     * */
    private static Object ParserJSONManual(Class jsonclass, String s){
        return null;
    }
5.最后<span style="font-family: Arial, Helvetica, sans-serif;">再加一个类</span>
@SuppressWarnings("serial")
public class JsSpinnerBean implements Serializable{
<span style="white-space:pre">	</span>private String keyName ;
<span style="white-space:pre">	</span>private String keyValue;
<span style="white-space:pre">	</span>private String keySelected;
<span style="white-space:pre">	</span>
<span style="white-space:pre">	</span>/**
<span style="white-space:pre">	</span> * 
<span style="white-space:pre">	</span> * @return 获得spinner key
<span style="white-space:pre">	</span> */
<span style="white-space:pre">	</span>public String getKeyName() {
<span style="white-space:pre">		</span>return keyName;
<span style="white-space:pre">	</span>}
<span style="white-space:pre">	</span>/**
<span style="white-space:pre">	</span> * 
<span style="white-space:pre">	</span> * @return  set  spinner key
<span style="white-space:pre">	</span> */
<span style="white-space:pre">	</span>public void setKeyName(String keyName) {
<span style="white-space:pre">		</span>this.keyName = keyName;
<span style="white-space:pre">	</span>}
<span style="white-space:pre">	</span>/**
<span style="white-space:pre">	</span> * 
<span style="white-space:pre">	</span> * @return 获得  spinner   Value
<span style="white-space:pre">	</span> */
<span style="white-space:pre">	</span>public String getKeyValue() {
<span style="white-space:pre">		</span>return keyValue;
<span style="white-space:pre">	</span>}
<span style="white-space:pre">	</span>/**
<span style="white-space:pre">	</span> * 
<span style="white-space:pre">	</span> * @return  set  spinner  Value
<span style="white-space:pre">	</span> */
<span style="white-space:pre">	</span>public void setKeyValue(String keyValue) {
<span style="white-space:pre">		</span>this.keyValue = keyValue;
<span style="white-space:pre">	</span>}
<span style="white-space:pre">	</span>
<span style="white-space:pre">	</span>/**
<span style="white-space:pre">	</span> * 
<span style="white-space:pre">	</span> * @return   获得  是否选中状态
<span style="white-space:pre">	</span> */
<span style="white-space:pre">	</span>public String getKeySelected() {
<span style="white-space:pre">		</span>return keySelected;
<span style="white-space:pre">	</span>}
<span style="white-space:pre">	</span>/**
<span style="white-space:pre">	</span> * 
<span style="white-space:pre">	</span> * @return   set spinner  是否选中状态
<span style="white-space:pre">	</span> */
<span style="white-space:pre">	</span>public void setKeySelected(String keySelected) {
<span style="white-space:pre">		</span>this.keySelected = keySelected;
<span style="white-space:pre">	</span>}
<span style="white-space:pre">	</span>




}

 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值