Liutauras Vilda wrote:Ah, sorry for not understanding right away.
Try similar to this approach:
Liutauras Vilda wrote:
stelios papamichael wrote:...i would like to present the encrypted msg to the user but i want the user to be able to copy it not just see it..
Please give an example, don't understand it.
Paweł Baczyński wrote:A Locale object represents a specific geographical, political, or cultural region.
In different languages and regions "to lower case" operation might mean different things.
For example.
In Turkish language (represented by new Locale("tr", "TR") in the example) the lower case of I is ı and not i as one might except.
Suppose, one writes a code like this:... and the person from Turkey wants to execute it typing "I" for input.
What do they see?
Illegal choice...
Because their I was converted to ı which was not matched by any case.
I mentioned this because one must be aware of this behaviour when using "shortcuts" (as toLowerCase)
Paweł Baczyński wrote:You can do:
Beware, toLowerCase() can act "strange" on some locales.[code=java]System.out.println("I".toLowerCase(new Locale("tr", "TR")));
Dave Tolls wrote:Instead of having two ImageButtons you'd have a ToggleButton.
Instead of using onClick you'd use the onCheckChanged (I think that's the method) which gives you the View (ie ToggleButton) and the new value (on or off).
You can remove the isOn flag.
Inside the listener (now onChange) you'd not worry about the visible/invisible stuff (so throw that away) you'd just worry about the flash bit:
Note that that is not copy/paste code!
Dave Tolls wrote:Why aren't you using a ToggleButton?
That would get rid of the whole logic around visible/invisible and the isOn flag.
You could then also use onCheckedChange instead of onClick.
Brian Tkatch wrote:I'm no expert. Still learning myself!
When using Android Studio, though, you can see the logs. Also, using Log.d() to specify a tag, and then filter on that tag to see what is going on. You can check if you are making it to onCreate(), at the very least.
Paul Clapham wrote:. . . just save the underlying data . . ..
Norm Radder wrote:
it created a Test.txt file on my desktop!
THere are two constructors used in that test program (line 9 and line 13). How do you know which one created the file? It's better to test one thing at a time so you know which one creates a file and which one does not create a file.