« first day (1776 days earlier)      last day (3162 days later) » 

1:00 PM
maybe my vocabulary isn't good enough... can you rephrase ?
 
Wow, no access requests! That might be a first
Ocus!
 
cM ! <3
 
nah, Ocus, I didn't quite get it either
Happy birthday, kind sir!
 
Thanks! I am finally 18. I can buy alcohol! VIRGIN MOJITOS HERE I COME!
Sadly, those are the only virgins I can get...
 
ocus, are you >50 years old? :)
 
1:04 PM
lol
 
LOL >50
 
Now I understood why he was not replying well to his birthday wishes. :-|
 
I'd say "I don't think 50 year olds understand how chat rooms work" but most of the people I was in chat rooms with at 18 are now over 50. Sad times.
 
Age is not important unless you're a cheese.
 
lol
 
1:13 PM
Or a wine
 
ocus, best wishes!
 
In what scenario is NOT using curly brace in an IF statement considered good coding?
 
if it's on a single line
 
none
 
Single line
 
The style guidelines I typically follow are if (condition) return value; is the only acceptable way with no brackets
Otherwise, even if it's a single statement, brackets
I used to not do brackets for single statements on a new line but people got pissed at me
 
"We require braces around the statements for a conditional. Except, if the entire conditional (the condition and the body) fit on one line, you may (but are not obligated to) put it all on one line. That is, this is legal:"
 
none
 
^
 
And then shows both if statement on one line with no brackets AND one with brackets over 3 lines.
 
1:17 PM
Similar to what Graeme said, but if the return statement is on the same line sometimes I just keep it like that, if it's sufficiently clear
 
I didn't see that there was an IF statement with no curly brackets, taken me ages figure out what was happening
 
haha
 
@AnubianNoob I can understand why when someone else tries to change the code
 
I agree with them now. It is pretty annoying and confusing. This isn't python or smth
 
Lol
Why cant I just create a simple timer grrr
 
1:25 PM
if statements without curly braces are an invention by satan to trick you
 
Are we for or against nested ternary operators, whilst we're on the subject?
 
I want to find the person who decided that was allowed and watch them stub their toe on something
 
I'm sorry to seem so dumb. Can any one provide me a way of doing an increasing timer
 
btw, today colleague of mine got baby boy and also is my daughter's fourth birthday. :)
 
exciting day then Netpork
 
1:27 PM
what do you mean "an increasing timer" matt?
 
Nesting ternary operators? You mean true ? false ? "Eh?" : "What?" : "Huh?"
 
system.currentTimeMillis() can be used to achieve a counter that is moving up
 
@user2160008 Access denied for default user name and low Q:A ratio.
 
Yep. Love me a good ternary
 
1:29 PM
jitters
 
return (a<=b)?((b<=c)?b:((a<c)?c:a)):((a<=c)?a:((b<c)?c:b));
 
So, what is a low Q:A ratio?
 
like, I want to time then length that my game is played for, so like 1.111 seconds.
 
> Make sure you’ve asked and answered reasonable questions on Stack Overflow. We expect you to have contributed somehow to Stack Overflow before joining the chat, and that you’ve answered at least as many questions as you’ve asked.
 
Matty - You don't need a timer, you need to get the start time (new Date().getTime()) and then when it finishes you get that time and minus them.
Yes, but what is a "good" ratio?
 
1:31 PM
@matty357 long startTime = System.getCurrentTime()
 
28 questions for 1 answer is a low ratio
 
Mine is like, 1 : 3
 
IMHO
 
then at the end long elapsedTime = System.getCurrentTime() - startTime
 
like this? long timeStart = System.currentTimeMillis();
long timeTaken = System.currentTimeMillis()-timeStart;
 
1:31 PM
24:435 :P
@matty357 exactly
 
thanks all, I think my brain is fried today, I've done it before but couldn't remember
 
1:87 for me
 
I think we should rethink the definition of a good ratio. is 30:29 a bad ratio?
nvm, it is
Answers are easy
I take that back
 
@user2160008 denied for default username and low A:Q ratio
 
too slow, cM !
 
1:33 PM
=x
 
oops!
 
he pulled me into a room to try to help him anway
 
And for pulling foamy into a room against his will
 
I tried not to, but I clicked the link anyway =(
 
1:35 PM
In some places, that's unlawful imprisonment and you can do some serious time
 
Thank You Netpork
 
But in some places it's also perfectly fine.
 
@netpork Why do you need a thread for that???
 
please use gist etc for posting code
:)
 
1:40 PM
I made it out alive, and didn't have to surrender too much of my blood
 
but how long till you can sit down normally again ? ^^
 
am sitting now, it's raining like a Mofo here though. And the power flickered out a few minutes ago. Probably because I've angered the gods
 
1:56 PM
@AnubianNoob if I recall right, I needed to display the counter or something
 
Oh right yeah, displaying the timer
 
2:13 PM
\oo to all the great people of room-15
If you ain't great, you don't have to say anything haha
 
_o_/
/
You're pretty great yourself too haha
 
Well I have finally got a very basic game going whoo. Now don't forget, i did say basic... filedropper.com/android-debug If any one would like a look. Just 1 stage at the moment, not polished off or anything, just a concept.
@Miva2 I know you like testing peoples apps.
 
Has anyone used a SearchView in a toolbar that isn't set as the ActionBar ?
 
@matty357 hmm?
 
2:24 PM
o.O Did I just pass a rep boundary? All of a sudden I'm getting flags to go and adjudicate..?
 
@DiegoFernandoLara Access denied. The minimum reputation required for access is 100 points on StackOverflow as stated by the rules.
 
I really need to learn Retrofit
 
I will teach you Retrofit if you help me with this stupid Toolbar problem :(:(
I'm tired and angry :(
 
@matty357 send the link again tomorrow, I'll try it then okay.
 
@Graeme Well you've hit 10k...?
What exactly is the problem?
SearchView in a toolbar?
MCVE?
 
2:27 PM
So, unless you set the ToolBar as the ActionBar, I can't find a way to get a MenuItem
I can only pull out the SearchView... which doesn't contain a collapse method
And Google is full of 100's of people asking "How do I collapse an Action Menu from a MenuItem"
 
ok Miva
 
Retrofit is pretty easy to use actually
 
graeme, cant you getViewById the elements you need?
Or am I miunderstanding your problem?
 
You can, but that comes back as a SearchView, not a MenuItem
0
Q: Collapse a SearchView from a Toolbar not set as an ActionBar

GraemeI don't know how to collapse a SearchView without a MenuItem and I don't know how to get a MenuItem from a ToolBar that isn't an ActionBar It's easy enough to add a SearchView to a Toolbar: Toolbar mToolbar = (Toolbar) toReturn.findViewById(R.id.toolbar); mToolbar.inflateMenu(R.menu.sear...

 
http://stackoverflow.com/questions/18115493/android-dynamicly-get-the-current-activity-in-foreground
http://stackoverflow.com/questions/3393908/how-to-get-any-identifier-of-the-topmost-activity
http://stackoverflow.com/questions/11411395/how-to-get-current-foreground-activity-context-in-android/28423385#28423385

There are all these questions similar to what I'm attempting. I still want to write a canonical Q&A. Too much of a duplicate?
 
2:38 PM
Pretty standard question Anubian, what question do you want to ask?
 
My original question title was gonna be "How to block other android apps programatically on pre-L?" but it's really two questions, "How to get the currently running activity" and "How to block the currently running activity"
 
"block" in what sense?
 
How to prevent an activity from being displayed to the user?
How to prevent it from running?
 
Your's or someone elses?
 
Someone else's, should make that clearer
 
2:40 PM
You cannot block someone else's Activity
 
How do I know when to use createView() or onViewCreated()? I'm putting a logo in the toolbar but I'm asking generally. I know what the methods are for, I just don't know if they can/should be created while the view is being created or only after.
 
@Graeme I can. I have. I am.
 
In which case I misunderstand what you mean by blocking! What are you achieving?
 
Prevent the activity from being shown to the user
 
2:41 PM
How? I know how to block the view, but not how to be notified by someone elses Activity happening (unless you're own is on screen)
I think it's impossible to actively stop it being loaded, or being interfered with apart from it being occluded by your own app.
 
That's what I've been doing this summer
Techinically your app is covering it, but you can make it so the user can't go back to the app before
 
I'm very interested if you've done any of the things I just said is impossible :)
 
Yeah, I'm writing a how to SO answer, but I'm not sure how to publish it
 
@miva2 Does it not depend on if the view should be created before doing something to it? so onCreate() sets up the view, onViewCreated() to make changes to the view after it is setup?
 
Write you're own question and answer it if you want to advertise just your answer
 
2:44 PM
I mean in two parts makes way more sense, but the question would be in duplicate territory... Idk if being way clearer and better answered is enough
 
You should write a question "How do I stop another apps' Activity from running?" and then answer it.
 
Yeah, but as I'm writing the answer, I'm finding it to be two parts
 
Anubian, how do you get the screen size in libGDX?
 
Gdx.graphics.getScreenSize() or smth
 
thanks
 
2:46 PM
And just for good measure there are two complete ways to know when a different activity starts
 
Daily stupidness...my latest code comment
//default high and low to 999 and -999 if empty (should be done better later on but have 1/2 day to implement this)
^ for everyone's enjoyment
 
I'd drop a // TODO in there
Otherwise it's gonna be lost
But if you don't care then don't bother
 
Lol...that would be a very good point if I thought it would matter at any point
I care because it's my code but that won't matter in the end. I have today to implement this feature for a training tomorrow and there has to be quote "NO BUGS"
I'm just venting. It will pass
 
when you get to the last part of the training, and you want to close the app, just do throw new RuntimeException();
that'll teach em
 
lol
 
2:52 PM
I'm gonna ask in SO Close Vote reviewers
 
haha
ask what?
 
About how to publish this stuff
blocking apps
nah I'll just ask in meta
 
you want to publish an app that blocks stuff?
 
damn
 
Sorry publish is a confusing word. I'm writing a question and answer, but because it's a borderline duplicate (but better) of established questions, idk if it's going to be received negatively
 
2:56 PM
you want to make an app that blocks apps?
depends on what you block
 
I'm writing an answer on how to detect app launches and how to cancel them
 
maybe Samsung bloatwares?
 
The point isn't about a certain app, it's about if his question will be received well on SO or if it's a dupe
 
aah
 
my question from this morning has 1 view, myself :(
sad times
 
2:58 PM
well meta rep doesn't really matter does it
go for it
 
no. only meta.se
 
Site metas only. SE meta is it's own site
So is there a meta.meta.stackexchange?
 
That's about as meta as you can get without going to Joel's house
 
you can cancel other activity launches?
 
well not exactly
You're technically starting one of your activities over it then ending it in such a way that it goes back to the launcher
I need to test how it'd look if you want to do it silently
 
3:08 PM
how's that done?
 
How do you end your Activity so it goes back to the launcher?
 
Magic
Well that half seems to have a lot of positive feedback haha
 
I love git push -f
@DiegoFernandoLara Sorry you need a rep of 100 to access this room
whups, focus already did that
hahaha @OcuS, autocorrect corrected you to focus as well
maybe that's a sign
 
3:13 PM
_o/
 
o/
 
@AnubianNoob Semaphore?
 
huh?
 
õ/
 
 
3:15 PM
_O_/
 
@AnubianNoob Flag semaphore is the telegraphy system conveying information at a distance by means of visual signals with hand-held flags
 
> In computer science, particularly in operating systems, a semaphore is a variable or abstract data type that is used for controlling access, by multiple processes, to a common resource in a concurrent system such as a multiprogramming operating system.
 
the "fourth" button
 
what does it do...?
 
3:26 PM
coherence mode for parallels desktop 11
 
makes virtual desktop like actual windows
 
\o
 
o/
 
3:36 PM
\⧬/
 
___O___/
 
The answers aren't exactly stellar either
 
3:55 PM
Sure the question is very basic but there's nothing wrong with having a good explanation on a frequently used method.
 
Yeah.
That's my point
But it got downvoted, hard.
And sometimes I see other questions, as basic as this one, getting upvoted, a lot.
 
Well this is a bad question that's broad unclear and shows no research
 
Hm... yeah. Broadness aside, take a look at this one: stackoverflow.com/questions/2025282/…
Still basic, no research, and one of the most upvoted questions I've seen on Android tag.
 
That's a great question, useful to future users of the site, not easily found with a google search. It has become the google seach.
 

« first day (1776 days earlier)      last day (3162 days later) »