Hello.I have a simple file.txt with only data the 1 but when put 
if(value=="1") no work why?

    File sdcard = Environment.getExternalStorageDirectory();

        //Get the text file
        File file = new File(sdcard,"LEDstate.txt");
        
        byte[] byteArray = new byte[(int) file.length()];
        try {
            new FileInputStream(file).read(byteArray);
        } catch (Exception e) {
            e.printStackTrace();
        }
        
        String value = new String(byteArray);
        
         if(value=="1"){
        //Find the view by its id
        TextView tv = (TextView)findViewById(R.id.txt);

        //Set the text
        tv.setText(value);
    //    }

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to