Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7939933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:14:26+00:00 2026-06-03T23:14:26+00:00

My string comparison is not working. I do not know why. It returns that

  • 0

My string comparison is not working. I do not know why. It returns that it is always equal even when the two strings are not the same

here is the code Im using

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

        //hideBackButton();
    }

The videoFile is intro_x.mp4 where x changes to number from 0 to 4 while INSTRUCTION_01 is into_0.mp4

the part of my onCreate that does sets videoFile variable

    //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

It shows that even as i compare them they return true but are not

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T23:14:27+00:00Added an answer on June 3, 2026 at 11:14 pm

    There’s a ; at the end of the “if” line, which terminates the “if” statement, therefore the following block is always executed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: String comparison in Objective-C I realize that the question is not very
I am working on an application that churns output based on comparison of string
I have a performance problem related to string comparison (in Java). I'm working on
the code to strip /Default.aspx and //www is not working (as expected): protected void
My string comparison doesnt work.I tried compare,equals ,= and all of these methods doesnt
I just found some strange behavior of database's order by clause. In string comparison,
I get this error when I try to use time_ago_in_words : Comparison of String
String[] a = c.toArray(new String[0]); First: Do I need type cast here? (I think
i have this issue working but i would like to know if there is
I’m working on some expression tree code written by a colleague and am looking

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.