1,参照http://blog.csdn.net/oney139/article/details/7435205,安装nfs-utils,命令: yum install nfs-utils
2,gedit /etc/exports 来设置共享的目录。在里面添加这句话:
/opt/FriendlyARM/tiny210/linux *(rw,sync,no_root_squash)
注意:/opt/FriendlyARM/tiny210/linux是我要共享的目录文件夹,注意这是个文件夹,而不是个文件。在这个文件夹下存放根文件系统。
3,查询nfs状态。命令:/etc/init.d/nfs status (注意这个命令 ,前面的/etc/...一定要写,即使你进到文件夹下也要带上绝对路径。)
查询结果:
rpc.svcgssd
is stopped
rpc.mountd is stopped
nfsd is stopped
相关命令:
/etc/init.d/nfs start
/etc/init.d/nfs stop
/etc/init.d/nfs restart
/etc/init.d/nfs
start 执行后,结果:
Starting
NFS services: [ OK ]
Starting NFS daemon: [FAILED]
参照http://group.ednchina.com/GROUP_MES_14273_1166_51595.HTM?jumpto=view_welcomead_1342492806562,用相关命令
查看防火墙状态:/etc/init.d/iptables status
暂时关闭防火墙:/etc/init.d/iptables stop
重启iptables: /etc/init.d/iptables restart
开启服务: service iptables start禁止防火墙在系统启动时启动
/sbin/chkconfig --level 2345 iptables off
关闭服务: service iptables stop
关闭防火墙后,依然解决不了问题。
奶奶的参考了众多资料依然不行,直接reboot或者init6重启后运行结果如下:
1)/etc/init.d/iptables stop 关闭防火墙
2)cd /
然后
exportfs -ra //当你修改 /etc/exports后可以使用此条使之生效
exportfs -v 查看nfs共享的目录
3)[root@localhost /]#/etc/init.d/nfs start
Starting NFS services: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
[root@localhost /]# /etc/init.d/nfs stop
Shutting down NFS mountd: [ OK ]
Shutting down NFS daemon: [ OK ]
Shutting down NFS services: [ OK ]
[root@localhost /]# /etc/init.d/nfs restart
Shutting down NFS mountd: [FAILED]
Shutting down NFS daemon: [FAILED]
Starting NFS services: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
[root@localhost /]# /etc/init.d/nfs restart
Shutting down NFS mountd: [ OK ]
Shutting down NFS daemon: [ OK ]
Shutting down NFS services: [ OK ]
Starting NFS services: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
竟然全部都OK了,真操蛋。
接下来参照我以前在ubuntu11.10上挂载nfs的经验http://bbs.witech.com.cn/thread-14486-2-1.html,先在本机上挂载个试试。
命令:
[root@localhost /]# mount -t nfs 192.168.2.211:/opt/FriendlyARM/tiny210/linux/ /mnt/
注意mount这句话的格式,mount a b,意思是将a挂载到b上,进入到b就可以查看a里面的内容了。不要搞翻了。
最后一步,将rootfs_qtopia_qt4.tar.gz这个文件 放到/opt/FriendlyARM/tiny210/linux/,/opt/FriendlyARM/tiny210/linux/是共享目录不要忘了。
在本机挂载通过,下一步我们就要将板子设置从nfs启动了。一定要再本机nfs挂载个试试,否则挂不上去查起来很麻烦。
通常情况下,OpenGL指令不是立即执行的。它们首先被送到指令缓冲区,然后才被送到硬件执行。glFinish和glFlush都是强制将命令缓冲区的内容提交给硬件执行。
一、glFinish()函数
OenGL手册上关于glFinish:
Name
glFinish — block until all GL execution is complete
C Specification
void glFinish(void);
Description
glFinish does not return until the effects of all previously called GL commands are complete. Such effects include all changes to GL state, all changes to connection state, and all changes to the frame buffer contents.
Notes
glFinish requires a round trip to the server.
Errors
GL_INVALID_OPERATION is generated if glFinish is executed between the execution of glBegin and the corresponding execution of glEnd.
glFinish()将缓冲区的指令立即送往硬件执行,但是要一直等到硬件执行完这些指令之后才返回。
如果直接绘制到前缓冲,那么在你想保存屏幕截图之前,就需要调用这个函数,确保绘制完毕。
如果使用双缓冲,则这个函数不会有太大作用。
二、glFlush()
Name
glFlush — force execution of GL commands in finite time
C Specification
void glFlush();
Description
Different GL implementations buffer commands in several different locations, including network buffers and the graphics accelerator itself. glFlush empties all of these buffers, causing all issued commands to be executed as quickly as they are accepted by the actual rendering engine. Though this execution may not be completed in any particular time period, it does complete in finite time.
Because any GL program might be executed over a network, or on an accelerator that buffers commands, all programs should call glFlush whenever they count on having all of their previously issued commands completed.
For example, call glFlush before waiting for user input that depends on the generated image.
Notes
glFlush can return at any time. It does not wait until the execution of all previously issued GL commands is complete.
Errors
GL_INVALID_OPERATION is generated if glFlush is executed between the execution of glBegin and the corresponding execution of glEnd.
glFlush()清空缓冲区,将指令送往缓硬件立即执行,但是它是将命令传送完毕之后立即返回,不会等待指令执行完毕。这些指令会在有限时间内执行完毕。
如果直接绘制到前缓冲,那么OpenGL的绘制将不会有任何延迟。设想有一个复杂的场景,有很多物体需要绘制。当调用glFlush时,物体会一个一个地出现在屏幕上。但是,如果使用双缓冲,这个函数将不会有什么影响,因为直到交换缓冲区的时候变化才显现出来。
如果你使用的是双缓冲,那么可能这两个函数都不需要用到。缓冲区交换操作会隐式将命令送去执行。
三、glFinish和glFlush的区别
看起来这两个函数很相似,但是仍然是有区别的。
一般,使用glFlush的目的是确保在调用之后,CPU没有OpenGL相关的事情需要做-命令会送到硬件执行。调用glFinish的目的是确保当返回之后,没有相关工作留下需要继续做。
glFinish会造成性能下降
如果调用glFinish,通常会带来性能上的损失。因为它会是的GPU和CPU之间的并行性丧失。
一般,我们提交给驱动的任务被分组,然后被送到硬件上(在缓冲区交换的时候)。如果调用glFinish,就强制驱动将命令送到GPU。然后CPU等待直到被传送的命令全部执行完毕。这样在GPU工作的整个期间内,CPU没有工作(至少在这个线程上)。而在CPU工作时(通常是在对命令分组),GPU没有工作。因此造成性能上的下降。
因此,应该尽量减少使用此函数。此函数的一个应用是:调试bug。如果我传输到硬件的某条命令造成了GPU的崩溃,找出使得GPU崩溃的那条指令的简单方法是在每个绘制操作之后调用这个函数。这样就可以准确找出造成崩溃的命令。
另外,Direct3D不支持Finish概念。
用于初学微云游戏引擎,供大家理解和构思一个完整的游戏。来源:http://www.i920i.com/article_show.aspx?id=15
可到右面网址下载完整APK。http://www.i920i.com/download.aspx
SuanshuActivity.java package li.suanshu; import com.umeng.analytics.MobclickAgent; import com.wiyun.engine.nodes.Director; import com.wiyun.engine.nodes.Scene; import com.wiyun.engine.nodes.Director.IDirectorLifecycleListener; import com.wiyun.engine.opengl.WYGLSurfaceView; import android.app.Activity; import android.os.Bundle; import android.view.Window; import android.view.WindowManager; public class SuanshuActivity extends Activity implements IDirectorLifecycleListener{ static { System.loadLibrary("wiskia"); System.loadLibrary("xml2"); System.loadLibrary("wiengine"); System.loadLibrary("wisound"); } protected WYGLSurfaceView mGLView; private boolean mStarted; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); mGLView = new WYGLSurfaceView(this); setContentView(mGLView); // add lifecycle listener Director.getInstance().addLifecycleListener(this); Director.getInstance().setDisplayFPS(false); Director.getInstance().setScaleMode(Director.SCALE_MODE_BASE_SIZE_FIT_XY); Director.getInstance().setBaseSize(480,800); } @Override public void onPause() { super.onPause(); Director.getInstance().pause(); MobclickAgent.onPause(this); } @Override public void onResume() { super.onResume(); Director.getInstance().resume(); MobclickAgent.onResume(this); } @Override public void onDestroy() { Director.getInstance().end(); super.onDestroy(); } @Override public void onDirectorEnded() { } @Override public void onDirectorPaused() { } @Override public void onDirectorResumed() { } @Override public void onDirectorScreenCaptured(String path) { } @Override public void onSurfaceChanged(int w, int h) { if(!mStarted) { mStarted = true; Scene s=Scene.make(); s.addChild(new Splash()); Director.getInstance().runWithScene(s); } } @Override public void onSurfaceCreated() { } @Override public void onSurfaceDestroyed() { } } MainMenu .java package li.suanshu; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.content.DialogInterface.OnClickListener; import com.wiyun.engine.nodes.ColorLayer; import com.wiyun.engine.nodes.Director; import com.wiyun.engine.nodes.Label; import com.wiyun.engine.nodes.Menu; import com.wiyun.engine.nodes.MenuItemSprite; import com.wiyun.engine.nodes.Scene; import com.wiyun.engine.nodes.Sprite; import com.wiyun.engine.transitions.RightPushInTransition; import com.wiyun.engine.types.WYColor3B; import com.wiyun.engine.types.WYColor4B; import com.wiyun.engine.utils.PrefUtil; import com.wiyun.engine.utils.TargetSelector; public class MainMenu extends Scene{ public MainMenu() { // TODO Auto-generated constructor stub ColorLayer clayer=ColorLayer.make(new WYColor4B(255, 255, 255, 255)); addChild(clayer,-10); //WYSize s=Director.getInstance().getWindowSize(); Label lTitle=Label.make("920爱学算术", 80); lTitle.setColor(new WYColor3B(122,167,2)); lTitle.setAnchorPercent(0, 0); lTitle.setPosition(15,650); addChild(lTitle); Sprite spJiaNormal = Sprite.make(R.drawable.jia); Sprite spJiaSelected = Sprite.make(R.drawable.jia1); MenuItemSprite itemJia = MenuItemSprite.make(spJiaNormal, spJiaSelected, null, new TargetSelector(this, "onJia(Object)", new Object[] { "加法运算" })); Sprite spJianNormal = Sprite.make(R.drawable.jian); Sprite spJianSelected = Sprite.make(R.drawable.jian1); MenuItemSprite itemJian = MenuItemSprite.make(spJianNormal, spJianSelected, null, new TargetSelector(this, "onJian(Object)", new Object[] { "减法运算" })); Sprite spChengNormal = Sprite.make(R.drawable.cheng); Sprite spChengSelected = Sprite.make(R.drawable.cheng1); MenuItemSprite itemCheng = MenuItemSprite.make(spChengNormal, spChengSelected, null, new TargetSelector(this, "onCheng(Object)", new Object[] { "乘法运算" })); Sprite spChuNormal = Sprite.make(R.drawable.chu); Sprite spChuSelected = Sprite.make(R.drawable.chu1); MenuItemSprite itemChu = MenuItemSprite.make(spChuNormal, spChuSelected, null, new TargetSelector(this, "onChu(Object)", new Object[] { "除法运算" })); Sprite spScoreNormal = Sprite.make(R.drawable.score); Sprite spScoreSelected = Sprite.make(R.drawable.score1); MenuItemSprite itemScore = MenuItemSprite.make(spScoreNormal, spScoreSelected, null, new TargetSelector(this, "onScore(Object)", new Object[] { "查看成绩" })); Sprite spAboutNormal = Sprite.make(R.drawable.about); Sprite spAboutSelected = Sprite.make(R.drawable.about1); MenuItemSprite itemAbout = MenuItemSprite.make(spAboutNormal, spAboutSelected, null, new TargetSelector(this, "onAbout(Object)", new Object[] { "关于程序和作者!" })); Menu menu=Menu.make(itemJia,itemJian,itemCheng,itemChu,itemScore,itemAbout); menu.alignItemsVertically(); addChild(menu); setKeyEnabled(true); autoRelease(true); } public void onJia(final Object arg) { Scene scene = Scene.make(); scene.addChild(new MainScene(), 0); Director.getInstance().pushScene(RightPushInTransition.make(1, scene)); } public void onJian(final Object arg) { Scene scene = Scene.make(); scene.addChild(new Jian(), 0); Director.getInstance().pushScene(RightPushInTransition.make(1, scene)); } public void onCheng(final Object arg) { Scene scene = Scene.make(); scene.addChild(new Cheng(), 0); Director.getInstance().pushScene(RightPushInTransition.make(1, scene)); } public void onChu(final Object arg) { Scene scene = Scene.make(); scene.addChild(new Chu(), 0); Director.getInstance().pushScene(RightPushInTransition.make(1, scene)); } public void onScore(final Object arg) { final int nMaxFen=PrefUtil.getIntPref("LiFen",0); final String strUser=PrefUtil.getStringPref("LiUser",""); ((Activity)Director.getInstance().getContext()).runOnUiThread(new Runnable() { public void run() { String strText="最高得分:"+nMaxFen+"\r\n"+"姓名:"+strUser; new AlertDialog.Builder(((Activity)Director.getInstance().getContext())).setTitle(String.valueOf("得分情况:")+"").setIcon( android.R.drawable.ic_dialog_info).setMessage(strText).setPositiveButton("确定", new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } }) .setNegativeButton("取消", new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } }).show(); } }); } public void onAbout(final Object arg) { ((Activity)Director.getInstance().getContext()).runOnUiThread(new Runnable() { public void run() { //String strUrl="file:///android_asset/about.html"; String strUrl=""; strUrl="<html><head><title>920 About</title></head><body>"+ "<H1>920爱学算术</H1><H4>作者:吴龙<H4><H4>Q Q:690310112</H4><H4>程序简介:适用于10岁以下儿童使用,测试儿童数学算术、脑力和反应快慢的小游戏。纯绿色程序,无任何广告。如果你感觉对您有帮助,可通过下面支付宝和银行帐号打款。算是对作者的捐赠。以后开发出更优秀的教育类应用和游戏。谢谢。</H4><H4>支付宝:18701002871 用户名:李志国</H4><H4>工商银行:622202 020006344 8548 开户地:工行昌平支行 用户名:李志国</H4><H4>官网:<a href=http://www.i920i.com>http://www.i920i.com</a></H4>" + "</body></html>"; Intent intent=new Intent(); intent.setClass(((Activity)Director.getInstance().getContext()), MyWebView.class); intent.putExtra("Http",strUrl); ((Activity)Director.getInstance().getContext()).startActivity(intent); } }); } } MainScene.java package li.suanshu; import java.util.Random; import android.app.Activity; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.util.Log; import android.widget.EditText; import com.wiyun.engine.nodes.Button; import com.wiyun.engine.nodes.ColorLayer; import com.wiyun.engine.nodes.Director; import com.wiyun.engine.nodes.Label; import com.wiyun.engine.nodes.NinePatchSprite; import com.wiyun.engine.nodes.Scene; import com.wiyun.engine.nodes.Scheduler; import com.wiyun.engine.nodes.Slider; import com.wiyun.engine.nodes.Sprite; import com.wiyun.engine.nodes.Timer; import com.wiyun.engine.opengl.Texture2D; import com.wiyun.engine.types.WYColor3B; import com.wiyun.engine.types.WYColor4B; import com.wiyun.engine.types.WYRect; import com.wiyun.engine.utils.PrefUtil; import com.wiyun.engine.utils.ResolutionIndependent; import com.wiyun.engine.utils.TargetSelector; public class MainScene extends Scene{ Label lShang=null; Label lXia=null; Label lDeng=null; Label lDui=null; Label lTitleRight=null; Slider slider1=null; int nQian=0; int nHou=0; int nDeng=0; String strDeng=""; Random r; TargetSelector mSelector1; int nJianGe=0; int nScore=0; public MainScene() { // TODO Auto-generated constructor stub ColorLayer clayer=ColorLayer.make(new WYColor4B(255, 255, 255, 255)); addChild(clayer,-10); r=new Random(); //WYSize s=Director.getInstance().getWindowSize(); // slider 1 Sprite bar = Sprite.make(R.drawable.bar); Sprite thumb1 = Sprite.make(R.drawable.thumb); slider1 = Slider.make(null, bar, thumb1); slider1.setEnabled(false); slider1.setValue(0); slider1.setShowFullBar(true); slider1.setAnchorPercent(0, 0); slider1.setPosition(-12, 720); addChild(slider1); Label lTitleLeft=Label.make("ARITHMETIC CARDS", 20); lTitleLeft.setColor(new WYColor3B(0,0,0)); lTitleLeft.setAnchorPercent(0, 0); lTitleLeft.setPosition(10, 750); addChild(lTitleLeft); lTitleRight=Label.make("SCORE:", 20); lTitleRight.setColor(new WYColor3B(0, 0, 0)); lTitleRight.setAnchorPercent(0, 0); lTitleRight.setPosition(300, 750); addChild(lTitleRight); lShang=Label.make("14", 100); lShang.setColor(new WYColor3B(0, 0, 0)); lShang.setAnchorPercent(1, 1); lShang.setPosition(300, 700); addChild(lShang); lXia=Label.make("14", 100); lXia.setColor(new WYColor3B(0, 0, 0)); lXia.setAnchorPercent(1, 1); lXia.setPosition(300, 600); addChild(lXia); Label lFuHao=Label.make("+", 110); lFuHao.setColor(new WYColor3B(0, 0, 0)); lFuHao.setAnchorPercent(1, 1); lFuHao.setPosition(180, 600); addChild(lFuHao); Label lXian=Label.make("_________", 60); lXian.setColor(new WYColor3B(0, 0, 0)); lXian.setAnchorPercent(1, 1); lXian.setPosition(330, 550); addChild(lXian); lDeng=Label.make("28", 100); lDeng.setColor(new WYColor3B(0, 0, 0)); lDeng.setAnchorPercent(1, 1); lDeng.setPosition(300, 480); addChild(lDeng); lDui=Label.make("", 120); lDui.setColor(new WYColor3B(255, 0, 0)); lDui.setPosition(400, 550); addChild(lDui); CreateButton("?",400,420,new TargetSelector(this, "JiSuan(int)", new Object[] { -2 })); CreateButton("7",150,300,new TargetSelector(this, "JiSuan(int)", new Object[] { 7 })); CreateButton("8",250,300,new TargetSelector(this, "JiSuan(int)", new Object[] { 8 })); CreateButton("9",350,300,new TargetSelector(this, "JiSuan(int)", new Object[] { 9 })); CreateButton("4",150,220,new TargetSelector(this, "JiSuan(int)", new Object[] { 4 })); CreateButton("5",250,220,new TargetSelector(this, "JiSuan(int)", new Object[] { 5 })); CreateButton("6",350,220,new TargetSelector(this, "JiSuan(int)", new Object[] { 6 })); CreateButton("1",150,140,new TargetSelector(this, "JiSuan(int)", new Object[] { 1 })); CreateButton("2",250,140,new TargetSelector(this, "JiSuan(int)", new Object[] { 2 })); CreateButton("3",350,140,new TargetSelector(this, "JiSuan(int)", new Object[] { 3 })); CreateButton1("0",200,60,new TargetSelector(this, "JiSuan(int)", new Object[] { 0 })); CreateButton("←",350,60,new TargetSelector(this, "JiSuan(int)", new Object[] { -1 })); mSelector1 = new TargetSelector(this, "updateLabel(float,int)", new Object[] { 0f, 1 }); Timer t = new Timer(mSelector1, 1f); Scheduler.getInstance().schedule(t); initSuan(); } public void updateLabel(float delta, int v) { nJianGe=v; //Log.e("Touch","jian:"+nJianGe); mSelector1.setArgument(1, v + 1); } private void CreateButton(String label, float x, float y, TargetSelector ts) { NinePatchSprite normal1 = NinePatchSprite.make(Texture2D.makePNG(R.drawable.btn_normal), WYRect.make(DP(9), DP(7), DP(22), DP(28))); NinePatchSprite pressed1 = NinePatchSprite.make(Texture2D.makePNG(R.drawable.btn_pressed), WYRect.make(DP(9), DP(7), DP(22), DP(28))); normal1.setContentSize(DP(80), DP(60)); pressed1.setContentSize(DP(80), DP(60)); Button bt1 = Button.make(normal1, pressed1, null, null, ts); bt1.setPosition(x,y); bt1.setClickScale(1.4f); addChild(bt1); Label label1=Label.make(label, 60); label1.setColor(new WYColor3B(255, 255, 255)); label1.setPosition(x,y); addChild(label1,2); } private void CreateButton1(String label, float x, float y, TargetSelector ts) { NinePatchSprite normal1 = NinePatchSprite.make(Texture2D.makePNG(R.drawable.btn_normal), WYRect.make(DP(9), DP(7), DP(22), DP(28))); NinePatchSprite pressed1 = NinePatchSprite.make(Texture2D.makePNG(R.drawable.btn_pressed), WYRect.make(DP(9), DP(7), DP(22), DP(28))); normal1.setContentSize(DP(180), DP(60)); pressed1.setContentSize(DP(180), DP(60)); Button bt1 = Button.make(normal1, pressed1, null, null, ts); bt1.setPosition(x,y); bt1.setClickScale(1.4f); addChild(bt1); Label label1=Label.make(label, 60); label1.setColor(new WYColor3B(255, 255, 255)); label1.setPosition(x,y); addChild(label1,2); } private void initSuan() { if (slider1.getValue()==100) { final int nMaxFen=PrefUtil.getIntPref("LiFen",0); final String strUser=PrefUtil.getStringPref("LiUser",""); ((Activity)Director.getInstance().getContext()).runOnUiThread(new Runnable() { public void run() { final EditText et=new EditText(((Activity)Director.getInstance().getContext())); String strText="最高得分:"+nMaxFen+"\r\n"+"姓名:"+strUser+"\r\n当前得分:"+nScore; new AlertDialog.Builder(((Activity)Director.getInstance().getContext())).setTitle(String.valueOf("得分情况:")+"").setIcon( android.R.drawable.ic_dialog_info).setMessage(strText).setView(et ).setPositiveButton("确定", new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub if (et.getText().length()>0 &&nScore>nMaxFen) { String strUrl=""; strUrl=et.getText().toString(); PrefUtil.setIntPref("LiFen",nScore); PrefUtil.setStringPref("LiUser",strUrl); Director.getInstance().popScene(); } } }) .setNegativeButton("取消", new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub Director.getInstance().popScene(); } }).show(); } }); } slider1.setValue(slider1.getValue()+5); nQian=r.nextInt(50); nHou=r.nextInt(50); nDeng=nQian+nHou; lShang.setText(String.valueOf(nQian)); lXia.setText(String.valueOf(nHou)); lDeng.setText(""); strDeng=""; lDui.setText(""); mSelector1.setArgument(1, 1); } float DP(float v) { return ResolutionIndependent.resolveDp(v); } float SP(float v) { return ResolutionIndependent.resolveSp(v); } public void JiSuan(int delta) { Log.e("Touch","Num:"+delta); if (delta==-1) { if (strDeng.length()>0 && strDeng.length()<8) { strDeng=strDeng.substring(0, strDeng.length()-1); } } if (strDeng.length()>4) { return; } switch(delta) { case -2: ((Activity)Director.getInstance().getContext()).runOnUiThread(new Runnable() { public void run() { AlertDialog.Builder builder = new Builder(((Activity)Director.getInstance().getContext())); builder.setMessage("答案:"+"\r\n"+nQian+"+"+nHou+"="+nDeng) .setPositiveButton("确定", new OnClickListener() { public void onClick(DialogInterface dialog, int which) { } }).show(); } }); break; case 0: strDeng+="0"; break; case 1: strDeng+="1"; break; case 2: strDeng+="2"; break; case 3: strDeng+="3"; break; case 4: strDeng+="4"; break; case 5: strDeng+="5"; break; case 6: strDeng+="6"; break; case 7: strDeng+="7"; break; case 8: strDeng+="8"; break; case 9: strDeng+="9"; break; } lDeng.setText(strDeng); Log.e("Touch","D:"+String.valueOf(nDeng)); if (strDeng.contains(String.valueOf(nDeng))) { Log.e("Touch", "Deng:"+strDeng); lDui.setText("√"); Log.e("Touch","JianGe:"+nJianGe); nScore=nScore+(int)((1000-nJianGe)/10); lTitleRight.setText("SCORE:"+nScore); Thread t=new Thread(new Runnable() { @Override public void run() { // TODO Auto-generated method stub try { Thread.sleep(1000); initSuan(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }); t.start(); } } }