Floating Action Button and EditText Problem - android

I have some problems with my android studio.
About 2 days ago, my floating button shows add icon(+) and works perfectly fine.
Last night when I opened android studio, icon didn't appear. It only showed background.
Another problem is EditText.
It doesn't appear on Design.
When I open another project, I am facing with the same problem. I can't see EditText.
Please tell me how I can fix them.strong textstrong text

Try these. They may helps :
Invalidate caches and restart.
2.Change theme in res>themes both to AppCompat
3.Sync the Gradle and rebuild project.
4.Check be sure there is no problem with your code

Related

How to refresh preview on Android Studio 2.2?

Now on Android Studio 2.2 on new Preview mode, there are no more refresh button:
Image 1: Preview on Android Studio 2.2 (without refresh button)
Image 2: Preview on Android Studio 2.1 (with refresh button)
Does anyone know how to display it again? Or with shortcut maybe?
Edit: If I change a drawable by example and that the change does not appear in the layout, the only method that works for me is closed and restart the project. If I close the layout and as I re-opens nothing happens. Same result using the "Synchronized" button.
Refresh feature is not removed, it is there; It's pretty simple to refresh:
Click on the preview screen to make sure preview window has the focus and press R. It should display the progress in the right-top corner while refreshing.
If it doesn't work for any reason, switch to design tab and press R, it refreshes the layout instantly.
I think it is a small bug. But I find a hack solution to resolve the problem, you can modify the a resource id to a wrong name, for example, you have a resource named 'ic_launcher', when you input 'ic_launcher1', you can find the interface like that:
next step, click refresh icon(sometimes it is 'clear cache' label). it is works for me.
I have try to change the orientation, but it not works when I replace a exist image file.
May your problem is same as : http://stackoverflow.com/questions/39646639/android-studio-2-2-layout-editor-refresh-button
Display again?
I guess you cant. Apparently the refresh functionality has been removed because they think the processing will happen much faster and will auto-refresh the previews real time. The Layout Editor's document has no mention of refresh functionality.
Shortcut?
If you are faster in making changes to your layout than Android-studio refreshes, you could try toggling between the design and blueprint views using the shortcut B
Refer the Layout Editor Official Documentation for other shortcuts you might feel comfortable with or works for you.
So do the Simple Step. When you change your layout then save it and clean your project.
go to menu Build -> Clean Project.
I Hope this will help you.
There is no refresh button in stable version of android studio 2.2 for preview. But there is a work around to do so. By toggling the orientation button in an editor will refreshes the changes!
I too had the same Problem , sometimes changing the Android Version worked
and it'll sure work if you clean/Rebuild the project
Find the double diagonal lines below your preview layout and click them. It will refresh your layout.

Drag/Drop feature in Android studio not working

I'm new to android programming The drag/ and drop feature in android studio is not working. I can't drag anything to my phone. Right now my fragment is google map view and i want to add a search bar to the view. It just doesn't drag. When I try to add it in text it says element item not allowed here?
This is my activity_maps.xml file
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:id="#+id/map" tools:context=".MapsActivity"
android:name="com.google.android.gms.maps.SupportMapFragment">
<item android:id="#+id/search"
android:title="#string/search_title"
android:icon="#drawable/ic_search"
android:showAsAction="collapseActionView|ifRoom"
android:actionViewClass="android.widget.SearchView" />
</fragment>
the new version of android studio uses 2 xml files for each layout. One (e.g. content_main.xml) embedded in the other one (Activity_main.xml).
you should open the content_*.xml and do the design in it.
hope it helps.
In addition to Hamed's answer I also had to:
File > Invalidate Caches / Restart ...
I'm missing vim.
The drag and drop feature is not working in Android Studio.... I also wasted a lot of time searching...what fixed my problem was to select a Theme for the Activity.
The image below will make things clear.
After updating to the latest version of Android Studio (2.2) I started having this problem.
After some searching and playing around I discovered holding down alt allows my to drag and drop. I had the "hold ALT to drag and drop" option checked under Settings-> Appearance & Behavior > Appearance.
Either I had already selected this option and a fix in Android Studio 2.2 made it so the option applied to dragging and dropping with the palette panel OR this option was recently added and defaulted to checked or a problem happened while upgrading that set it to true.
I have this option set in IntelliJ and have used the android studio palette normally before and am mostly sure I used it without having to hold down alt before so I'm going with option A (and it took me an embarrassing amount of time until I tried holding down alt).
In my case, I was using ConstraintLayout in Android Studio 3.0. Fixed it by using android.support.constraint.ConstraintLayout instead.
Go to your "values" folder
and open the "styles.xml" file.
Replace "Theme.AppCompat.Light.DarkActionBar" under the parent tag with "Base.Theme.AppCompat.Light.DarkActionBar"
I faced this problem also and I simply fixed that by changing the theme to DeviceDefault.Light for the activity.
I also faced the same problem. The culprit was that in my parent
android.support.wearable.view.BoxInsetLayout
tag i was dragging the components directly but when i put
FrameLayout
inside
android.support.wearable.view.BoxInsetLayout
tag and then drag my components to
FrameLayout
it worked .
Hope it will help someone.
I know this is old but not being able to drag elements into the design just happened to me (2/18/18). Restarting Android Studio (3.01) did the trick.
I faced the same problem of not dragging elements in Android Studio 3.1.
Restarting the Android Studio, fixed the problem for me
I figured it out. Even though the design panel is visible as well as the Palette and Component Tree I ALSO need to have app/src/main/res/layout/fragment_main.xml selected over in the Project panel in order for the actual design of the layout to be enabled.
Drag 'n' Drop may not work properly, when you have a LinearLayout, in that condition, the items you drag will try to settle in a specific manner(Horizontal or Vertical), instead try to change your main layout to Relative Layout
Linear Layout --> Relative Layout
I know this is a old issue,none of these were working for me, and it so happened that it wasn't android studio that was giving this problem it was windows. I noticed I couldn't drag anything so clicking and holding any file on the desktop and pressing escape is what fixed it for me.
I resolve this problem by simply rebuild my android studio project.
I was facing the same problem,but then I found the solution .
All you have to do is select the element you want to add(eg. Button) and press "Enter".
The component will be displayed on your screen.
Or you can select the component and right click -> Add to Design
I have did everything in this post, until I've run android studio by just running and not running with "Run As Administrator"(Right Click -> More -> Run As Administrator). I've used to run android studio with "Run As Administrator" and that caused the problem to not drag and drop. Just run Android Studio without "Run As Administrator".
Or try do vice versa and actually "Run As Administrator" if you already just running it without "Run As Administrator".
File>Settings>Appearance and Behavior>Appearance>Theme -> IntelliJ Light
Change your settings to the above path. Then you can drag and drop the views on the design view.
I was also confused with the drag&drop feature. Until I figured out:
After beginning to drag you have to release the mouse button and everything works fine.
Nice feature - a bit unusual though.
I just downloaded Android Studio and ran into this problem.
After clicking random buttons for a few minutes I found out:
There's a magnet icon in the toolbar right above the design view called "Disable Autoconnection to Parent". After I clicked this I was able to move the button wherever.

Rendering problems missing styles after every update

I get the "Rendering problems. Missing styles. Is the correct theme chosen for this layout?" and the gradle resolving without end after every android studio update, making my entire code non runnable. Only solution is to just recreate my project. Is there any solution to this? It is really, really annoying.
Try to Invalidate Caches and Restart. In Android Studio go to the File menu and choose Invalidate Caches / Restart and confirm with Invalidate and Restart.
An image showing the appropriate menu item in Android Studio:
Simply click on the Refresh icon:          
Maybe a bit late, but this may help others...
Had the same problem and had another Error below: failed to find '?attr/textEditSuggestionItemLayout' with 9 similar errors not shown. The textEdit, which i made bold above made me thinking if the error had something to do with the TextView and if the missing styles relate to the TextView Styles. Although I had no more TextView´s in my Layout I gave it a try and added <item name="android:textViewStyle" >#style/AppTheme</item> and it worked, no more error messages to this. Maybe this can still help someone.
Happy coding

Android studio IDE Layout changed after Upgrade to 1.5

How to change back the layout of the IDE (Android studio) to normal position? As you can see the make project button, run program button and etc are on the far right. This happend after I updated the IDE to 0.5.5. Please help me. Thank you. Shift-F12 don't work.
The Picture below should be the normal one i think.
You've hidden the toolbar. Use View menu > Toolbar to restore it.

No Graphical layout editor in Android

I imported an Android project in Eclipse. Somehow, the layout editor does not open automatically when I open a layout! After I open it, it gives me the 'Graphical Layout' tab but it is still an empty frame! The only difference I see from my previuos projects is that the top drop-down menu has an option called "Locale" while the older ones had "Any locale".
Please advise.
Restart eclipse. I always close eclipse when this error happens and restarting it after that and my problem got resolved.
Something similar happened to me today and I found that if I closed the window/tab and opened again a few times it fixed itself. It was annoying though. Also try going into the xml tab and edit something in there and go back to the Graphical Layout.
Something similar happened to me a few versions of ADT for eclipse ago.
EDIT
Ok it has just happened to me once again. What I did to resolve was to change the Android version to something else. It's the drop down box beside the Create... button. That made it reappear
I have the same problem, it goes away if I switch to XML view and make a single edit, and then save. Then switch back to graphical layout and the error is gone.
It wasn't working for me no matter what I did. But it started working again when I deleted a bunch of projects in my workspace. My theme for eclipse was also deleted when I did this too, I'm not sure why.

Categories

Resources