English 中文(简体)
努力比较不工作(Rodid)
原标题:String comparison not working (android)

我的细微比较没有发挥作用。 我不知道为什么。 它指出,即便两个阵列并非相同,也总是平等。

这里使用的是《刑法》。

if(videoFile.equals(LangSelect.INSTRUCTION_01));
    {
        Log.i("InstructionVideo", "video and instruction are equal
"+ videoFile + "
" + LangSelect.INSTRUCTION_01);

        //hideBackButton();
    }

摄像器是内装的x.mp4, 而INSTRUCTION_01=0.mp4。

我在座的那部分录像带 文件变数

    //get which video file to play
    videoFile = getIntent().getExtras().getString("PlayVideo");

    Log.i("InstructionVideo", "videoFile name: " +videoFile);

Here is the LogCat of that portion

 05-15 14:59:57.078: I/InstructionVideo(2952): videoFile name: intro_0.mp4
 05-15 14:59:57.085: I/InstructionVideo(2952): video and instruction are equal
 05-15 14:59:57.085: I/InstructionVideo(2952): intro_0.mp4
 05-15 14:59:57.085: I/InstructionVideo(2952): intro_0.mp4
 05-15 14:59:57.124: I/surfaceCreated(2952): created
 05-15 14:59:58.324: I/LangSelect(2952): 7
 05-15 14:59:58.390: I/InstructionVideo(2952): videoFile name: intro_1.mp4
 05-15 14:59:58.390: I/InstructionVideo(2952): video and instruction are equal 
 05-15 14:59:58.390: I/InstructionVideo(2952): intro_1.mp4
 05-15 14:59:58.390: I/InstructionVideo(2952): intro_0.mp4
 05-15 14:59:58.433: I/surfaceCreated(2952): created
 05-15 14:59:58.484: I/SurfaceDestroyed(2952): destroyed
 05-15 15:00:07.382: I/LangSelect(2952): 7
 05-15 15:00:07.445: I/InstructionVideo(2952): videoFile name: intro_2.mp4
 05-15 15:00:07.449: I/InstructionVideo(2952): video and instruction are equal
 05-15 15:00:07.449: I/InstructionVideo(2952): intro_2.mp4
 05-15 15:00:07.449: I/InstructionVideo(2952): intro_0.mp4
 05-15 15:00:07.488: I/surfaceCreated(2952): created
 05-15 15:00:07.539: I/SurfaceDestroyed(2952): destroyed
 05-15 15:00:23.535: I/LangSelect(2952): 7
 05-15 15:00:23.597: I/InstructionVideo(2952): videoFile name: intro_3.mp4
 05-15 15:00:23.597: I/InstructionVideo(2952): video and instruction are equal
 05-15 15:00:23.597: I/InstructionVideo(2952): intro_3.mp4
 05-15 15:00:23.597: I/InstructionVideo(2952): intro_0.mp4
 05-15 15:00:23.632: I/surfaceCreated(2952): created
 05-15 15:00:23.687: I/SurfaceDestroyed(2952): destroyed
 05-15 15:00:38.843: I/LangSelect(2952): 7
 05-15 15:00:38.902: I/InstructionVideo(2952): videoFile name: intro_4.mp4
 05-15 15:00:38.906: I/InstructionVideo(2952): video and instruction are equal
 05-15 15:00:38.906: I/InstructionVideo(2952): intro_4.mp4
 05-15 15:00:38.906: I/InstructionVideo(2952): intro_0.mp4
 05-15 15:00:38.941: I/surfaceCreated(2952): created
 05-15 15:00:38.992: I/SurfaceDestroyed(2952): destroyed
 05-15 15:01:13.242: I/LangSelect(2952): 7
 05-15 15:01:13.296: I/SurfaceDestroyed(2952): destroyed

它表明,即使对他们进行对比,他们还是真实的,但并非真实的。

最佳回答

有一个<代码>;,在终止“如果”声明的“if”线后终止,因此始终执行以下部分。

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签