Activity templates disappeared from new project in Android Studio - android-studio

Hi I am new to programming and wanted to create a new project in Android Studio for experimentation.
I wanted to start with the Empty activity which creates the Hello World program but suddently its no longer possible. The window which I get when I click
is compleatly different.
Instead of getting the window which lets me select the target API and activity type I get this
And from there It only lets me select project name and whether or not it creates the basic main main java method. No XML no nothing.
I dont know what happened
EDIT: I would like to add that I deleted .gardle yesterday once because it was a solution to another problem I had earlier

I solved this myself by resetting Android studio by deleting .AndroidStudio2.3
Resetted all setting which sucks a bit, but I rather have that.

Related

visual layout editor does not allow drag&drop

I'am a newby in android studio and learning a lot, but now have a problem where i cannot seem to find the answer to.
In android studio you can visualy drag&drop your screen.
I have seen it can do al lot (although you sometimes need the xml) but for me it is not working at all.
I mean i cannot drag&drop any widgets on the screen at all.
Tried changing the theme: no help (really tried a lot of them)
Tried a complete new project: same story
Tried other APK verion: same story
Tried Invalidatd caches / restart: no help
Even with a new project (EmptyActivity) it add's a android.support.v4.widget.NestedScrollView and then gives error's on that
(Failed to find style 'coordinatorLayoutStyle' in current theme).
It also gives an error on layout_height/layout_with not being there. But they are there for each widget.
Please do not missunderstand: when i execute the project i runs just fine (both on phone and emulator) but the visual builder for the screen.....:-(
Does somebody knows how to solve this.
If more info is needed please ask.
Any help is more than welcome.
There are several things that could be causing this:
Your caches could be messed up. Try going to
File > Invalidate Caches / Restart ... (I know that you already tried this, but posting for future views.)
Also, make sure that you don't have Drag-n-Drop with ALT pressed only checked in your Settings (Appearance & Behavior - Appearance).
Finally, in a default project created in Android Studio, there are two XML files created for each layout. For example, content_main.xml is embedded within activity_main.xml. Make sure that you are using content_main.xml for your design work.
In the end i fixed it by changing the SDK version in de gradle file.
still do not understand why it was wrong as studio genereded it that way but now it works so.... for me: case closed.

Content_Main and Activity_Main in Android Studio 1.4: If I put a button in activity_main, but not content_main, will the java file know about it?

I'm a beginner to android but have done a little with an older version of Android Studio, and in the new version I'm having a lot of trouble getting the java file to find buttons or ImageViews. I'm not sure if it's related to the content_main vs activity_main thing. I'm having trouble finding any answers as to how this works on Google, so I'm just starting here, I want to put a button on the main page of my app and have the java file that correlates to the XML file find it. How do I do this?
Answers online are very vague to me, things like "activity_main.xml will determine how the look of the main activity should be. And on the other hand content_main.xml will determine the contents in the activity_main.xml" does not mean anything to me. Please tell me where to put the button!
If you are adding a button in activity_main rather than content_main it cannot be recognized by your Java file. Not only that is will even not be visible on your app.

How to choose which file to debug in Visual Studio 2012 prof

Kinda stupid question, but I've only been using this IDE for two days now. I havent found anything in google yet and I figured that once in a while you're entitled to a stupid question:
I have a project (or solution as Microsoft chose to call it) with two .cs-files. When I click on debug, it's alwys the same file that opens. How can I get VS to open the other .cs-file?
It sounds like you have multiple static Main methods in your project. If that's the case then you have to set the startup object to the object that you want to run.
Right-click on the project in the Solution Explorer and select
Properties (or select Project >> Projectname Properties from the
toolbar).
On the Application form, select the appropriate value
for Startup Object.

Class Files not visible in Visual Studio 2011

I ran Visual Studio 2012 today and tried to create a new solution with projects contained within.
The class source code for the boiler-plate Class1 file is not visible. If I create a new class, the source code is also not visible.
When I click on a class file, the tab file opens with the class name but there is no source code. Just a background color that was there before. If I try to open any class file in notepad then the source code is visible. The only thing I have done today is uninstall continuous tests after having a play with it. This happens on any new project I create or with existing projects.
Has anyone seen this before and do you have a solution? Ta very much.
*I cannot post images as I do not have enough reputation yet.
Ok, so problem solved. I had uninstalled Continuous Tests via the control panel and that was that. However, the plug-in was still visible from the Visual Studio add-in manager. I performed an uninstall from there and everything started working fine again. Source code is now visible. I can only put it down to the incorrect uninstall procedure. – DannyDuttser

How to add an external project to Xcode 4?

I am stuck with an issue of including an project in Xcode 4. I have all the document but it works with Xcode 3 and not Xcode 4.
How to add ZXingWidget.xcodeproj to my project in Xcode 4?
In Xcode 4, you're mostly meant to create a new Workspace to which you can add multiple projects. From the main menu: File > New... > New Workspace...
Once you create your new workspace, drag the Xcode project files into the project navigator of the newly-created workspace. Drop the first one anywhere in the project navigator pane but be careful to note the insertion pointer when you drop the second one. Advice: Drop it beneath the entire first project but with your pointer as close to the left edge of the project navigator panel as you can get. This makes sure you're not inserting a project into another project.
In this way, you get all the benefits of a workspace (automatic dependencies, etc.) without changing the structure of the projects themselves. Then you simply open the workspace rather than the individual projects within it.
Despite that this question had been asked months ago, here is a great resource directly answering it. It worked flawlessly for me (even though I had ARC turned on for the main project I was importing it into).

Resources