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 3333716
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:49:37+00:00 2026-05-17T23:49:37+00:00

Hey guys, I have this code for an android application, the funny thing is

  • 0

Hey guys, I have this code for an android application, the funny thing is that data is never equal to datas, can you guys explain me why, and if in case give me new read / write file functions :/ , thanks

   String datas = "volume of";
    writesettings(datas);
    String data = readsettings();
    String data2 = "volume of";
    if (data == datas) {
     System.out.println("success");
    }
    System.out.println(data);
    System.out.println(data.length());
    System.out.println(datas.length());
}
// Write Settings
public void writesettings(String data){ 
    try {      
  FileOutputStream fOut = openFileOutput("settings.dat", MODE_WORLD_READABLE);
  OutputStreamWriter osw = new OutputStreamWriter(fOut); 
  osw.write(data);
  osw.flush();
  osw.close();
 }catch(Exception e){
  e.printStackTrace(System.err);
 }
}
public String readsettings(){
 try {
  FileInputStream fIn = openFileInput("settings.dat");
  InputStreamReader isr = new InputStreamReader(fIn);
  char[] inputBuffer = new char[9];
  isr.read(inputBuffer);
  String readString = new String(inputBuffer);
  datax = readString;
  isr.close();
 } catch (IOException ioe) {
  ioe.printStackTrace();
 }
 return datax;
}
  • 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-05-17T23:49:38+00:00Added an answer on May 17, 2026 at 11:49 pm
    1. You don’t compare string using the equals (==) operator in Java. They’re objects. You need to use equals().
    2. System.out.println doesn’t work on Android. Use Log.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys, I have this quick bit of code that I can't figure out
Hey guys I have a weird error I wrote this code against setbubblepopup $(document).ready(function
Hey guys i have a ListActivity... a very simple at that... and it keeps
Hey I have this code right here: http://pastie.org/534470 And on line 109 I get
Hey guys, I have developed a small site that i would like to embed
UPDATE: I have determined that the SQLClient code times out on the first call,
Hey guys I have a simple create method with some validations and whenever the
Hey guys I am having a lot of trouble trying to understand this and
Hey guys..I am designing a set-up wizard using CPropertySheet and CpropertyPage in MFC application...I
hey guys, i'm getting an exception on the following inner exception: {Value cannot be

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.