动态更新在Android中数据的价值 [英] dynamically update data value in android

查看:95
本文介绍了动态更新在Android中数据的价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的第一个活动必须开发通过SOAP calling..it登录表单(用户名,密码和按钮)成功合作。

In my first activity have to develop login form(username,password and button) via soap calling..it is worked successfully.

在第二届活动在使用XML解析到的ListView ......它也运作良好。

In 2nd activity have to listview using xml parsing...it is also worked well.

在3日的活动有特定的顺序显示的细节描写。(如果我必须单击在第二活动的任何阶表示为了详细说明显示在3日的活动)......也正是在这个工作good.also活动有一个按钮(更改订单状态)..如果我必须点击该按钮意味着它是进入4 ..活动

In 3rd activity have to displayed detail description of particular order.(if i have to click the any order in 2nd activity means that order detail description is displayed in 3rd activity)...it is also worked good.also in this activity have one button(change order status)..if i have to click the button means it is go to 4th activity..

在4日的活动一定要显示一个字段微调(状态)......这里的微调值是通过在第四届活动肥皂调用更新中...但下面的工作方式查询更新xcart_orders设置状态= '+状态+',订单ID ='+ ORDERID +阿凡订单ID ='12' ...
但它不工作了此查询

In 4th activity have to display one field spinner(status)...here the spinner value is updated via soap calling in 4th activity...but is worked below query means UPDATE xcart_orders set status = '"+Status+"',orderid = '"+Orderid+"' where orderid = '12'... but it is not worked for this query

更新xcart_orders设置状态='+状态+',订单ID ='+ ORDERID +阿凡订单id ='+ ORDERID + ...

所以我想需要使用上面的查询,点击在第二届活动的任何订单意味着它进入第三个活动......现在我要点击更改状态才能按钮意味着它是进入第四activity..the第四项活动我一定要改变现状意味着状态在特定orderid..please更新,我该怎么办发展这个....请帮我...怎么在这里管理code ...

so I wish to need to use above query and click the any order in 2nd activity means it is go to 3rd activity...now i have to click the change status order button means it is go to 4th activity..the fourth activity i have to change the status means that status is updated in that particular orderid..please how can i do develop this....please help me...how is manage the code here...

在这里我请参考code: SingleMenuItemActivity (SingleMenuItemActivity)
http://pastie.org/4656261InsertionExample )的 http://pastie.org/4656262(更新

Refer my code here:SingleMenuItemActivity(SingleMenuItemActivity) http://pastie.org/4656261InsertionExample) http://pastie.org/4656262(update)

推荐答案

您不能因为你正在更新相同的值要在其上放置更新这样的地方的条件。

You can't update like this because you are updating same value on which you are putting where condition.

假设你想要更新的OrderID 12到13,然后你的查询应该喜欢这个
字符串orderid1 = 13;
字符串orderid2 = 12;
UPDATE xcart_orders 设置状态 ='+状态+'订单ID ='+ Orderid1 +'其中,订单ID ='+ Orderid2 +'

Suppose you want to update orderid 12 to 13 then your query should like this String orderid1 = 13; String orderid2 = 12; "UPDATE xcart_orders set status = '"+Status+"',orderid = '"+Orderid1+"' where orderid = '"+Orderid2+"'"

但你的情况,你使用的是相同的变量在这两个地方,它会即将举行,如果存在价值在数据库中但在这种情况下,执行该查询没有意义的工作。

But in your case you are using same variable at both places, It will work if upcoming values exists in your database but there is no meaning for executing that query in that case.

如果您还有什么疑问恢复。

If you still have any doubt revert back.

这篇关于动态更新在Android中数据的价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆