Ted Schrey

Ranch Hand
+ Follow
since Nov 27, 2014
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
4
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ted Schrey

I'm working on a tutorial to take photos. First thing is to tell manifest that I'll be using the camera feature. Everything I find says to and the feature in uses with: name="android.hardware.camera", but in Android Studio, the autofill is Camera with a line through it (depreciated). Has this changed? I see .camera2. Is this the replacement for .camera?
7 years ago
I have Android Studio 1.5.1
I am trying to drag a .png photo of about 70Kb size into my drawable file so I can use the photo image. But as soon as I drop it in, I get the dialogue box that says Move, but then the whole thing freezes up. I have to do a force-quit of Android to get going again. Any help would be appreciated!
8 years ago
I've re-downloaded Studio (again) and I've added every SDK update using administrator sign in but I still seem only to be able to use the AppTheme or AppTheme,NoActionBar. Everything else gives me the following. Any input would be appectiated! (Material Light here.. Nexus 4, API23):

it says "Rendering Problems. Missing Styles. Is the correct theme chosen for this layout? Use the Them combo box above the layout to choose a different layout, or fix the theme style references.

NOTE: One or more layouts are missing the layout_width or layout_height attributes. These are required in most layouts."



It gives a link to Automatically add all missing attributes, but when I click on it, nothing happens.
It also has a link t Copy stack to clipboard, which gives the following:

java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or descendant) with the design library.
at android.support.design.widget.ThemeUtils.checkAppCompatTheme(ThemeUtils.java:34)
at android.support.design.widget.CoordinatorLayout.<init>(CoordinatorLayout.java:178)
at android.support.design.widget.CoordinatorLayout.<init>(CoordinatorLayout.java:172)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:458)
at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:170)
at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:103)
at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:168)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:247)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:171)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:394)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:223)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:426)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:510)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:498)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:888)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:498)
at com.android.tools.idea.rendering.RenderTask.access$600(RenderTask.java:72)
at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:610)
at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:607)
at com.android.tools.idea.rendering.RenderService.runRenderAction(RenderService.java:362)
at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:607)
at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:629)
at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$6.run(AndroidDesignerEditorPanel.java:480)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:351)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
8 years ago
I am just starting a tutorial to learn android, using android studio. in the tutorial, they are dragging the widgets onto the design screen of the activity_main.xml file. Mine wont let me do so, but has an additional file (not showing in the tutorial) called content_main.xml where I CAN drag and manipulate the widgets. Is this normal, and/or has something changed in latest Studio regarding this? I just downloaded Studio yesterday.
8 years ago
...and Joe Ess, that link contains a lot of good info... thank you.
8 years ago
I appreciate your input.... it is very informative and helpful Bear Bibeault! Thanks
8 years ago
I have always been a Windows user. am am still learning to program. I'd say I'm at the end of being a "beginner" but still a relative newbie. I've gotten most Core Java and some GUI and am now also studying Android. So, although I want to develop Apps at some point, I have a ways to go. With that said, I need a new computer very soon and want one that will carry me through a good number of years of programming. I'm thinking of Apple this time, though I am not sure if in the next few years I'll have any Apps ready in Android that I want to then have in OIs (will have to learn that too!). For the price, it looks like I can purchase more speed from a PC, (around $2K max for me!), but I always hear such good things about Mac. I like Netbeans better than Eclipse, though use both, and also Android Studio, which I'll probably be using for all my Android work. Can any of you Mac folks (preferably who have used both systems) tell me why you are Mac folks rather than PC users?
8 years ago
ahh, got it... thanks!
8 years ago
I have an assignment where I need to modify a method, which they already put an if-statement in there... if the condition not met, it gives a return, but it is a void method. What does a return do in a void method?

eg:

8 years ago
I tried something that seems to work, though it looks clumsy to me, I guess I'll use it.
Sorry for posting too quickly!


8 years ago
I know I can print the key: mapName.keyset(), but I can't seem to assign it to a variable...
8 years ago
if I have only one remaining key/value set in a HashMap (removed all others), how can I retrieve the key



8 years ago
sorry about the delay.... I'd been sidetracked! I do appreciate all of the input though a lot (most?) of it was over my head .... anyway, i think my post wasn't clear enough. It really is not a matter of precision in this particular case. Rather the conditions of the "problem" stated that "if "0", then no possibility" and if "1" 100% of the time". I think it was a bad set of directions and bypassed it after finding nothing in Java to get an inclusive 1.... and I do see why. That would make no sense, because if 0 is inclusive, then 1 is past the upper limit. Sorrowful example, but I think it's like the 1st century can only go up to midnight of the 99th year.... once it reaches 100, it's the next century. Thank you once again. I sure see a lot of brain power from you all... I am amazed in fact.
8 years ago
I need to have inclusive for use in a probability determination. Specifically the probability that something exists. if 0.0, definitely does not exist. anything between 0.0 and 1.0, it might exist to the degree of probability and if 1.0 it definitely exists. I know I can't use Math.random() since it excludes 1.0.

Is there a way to do this?
8 years ago
I have a basic question to try to understand the getContentPane() method...

First, if I create a method to add components to my outer frame:


I am of the understanding that I call it using (in a UserInterface class which implements Runnable)


But it seems to work just fine if I just use (without the .getContentPane())....


I did read Oracle on it, and they indicate that you don't get all the benefits of the ContentPane (class) unless you use the method and will only get the default layout, etc. in a JFrame.... I think I see that, though if I don't change the layout of the JFrame, does it matter?


Second, I guess this question is separate, but I am asking both at same time because I think they are related enough to help understanding.. In that same createComponents above, now, to add the KeyListener, it gets added directly to the JFrame, NOT the component (frame.getContentPane()). Why now do we go directly the frame?
8 years ago