Android Studio sometimes using the deprecated ''fill_parent' - android

I just downloaded Android Studio May 10, 2014 and started using the rich layout editor.
I noticed that when I would drag and drop a RelativeLayout, Android Studio would automatically use fill_parent for both the layout_width and the layout_height attributes.
Why does Android Studio not fill in the non-deprecated value, match_parent by default?

It has been filed as a bug but has not yet been confirmed. You can see the bug report here.

Because it's in alpha stage of development :)

Related

Constraintlayout bug Android Studio

I was happily developing on Android (making some design) when I moved a button up in hierarchy and everything got weird. I'm using Constraintlayout for better alignment.
As you can see, on the blue screen there's no two buttons neither Guidelines.
I tried to rebuild but some NonInfo Nullpointer appeared
Any suggestion? Do I have to re-do everything from scratch?
Info: I was editing it on Landscape before this happened
If you could post your XML, that would be helpful. Which version of ConstraintLayout are you using? Also, you should check out Android Studio 2.3, we made a ton of improvements in the layout editor.

Android API 20L preview and API 204.4W

here I face one problem after updating this both API level 20 (L and W). in my XML Graphical view the layout is not generated instead it is showing me this error:
Missing styles. Is the correct theme chosen for this layout?
Use the Theme combo box above the layout to choose a different layout, or fix the theme style references.
and also shows an error in res/values/styles.xml in this line
style name="AppBaseTheme" parent="Theme.AppCompat.Light
I use Eclipse juno.
To keep it simple, what you can do is select API 19 in the graphical layout and keep targetSdkVersion="19" and that should solve your problem. Basically the issue is with API20 bundles by google.
More insight about the issues with API 20L or 20W are already highlighted at below SO questions already...I've also responded with the google bug tracking link. Please have a look at those...
Many many issues, eclipse, android MediaPlayer, etc
latest 'ADT BUNDLE' open as JUNO eclipse for windows 7 64 bit
Hope this helps...

Mono for Android - Layout Designer Issue

I'm using Mono for Android 4.2.4 with VS 2010. The layout designer does not refresh properly if you change the theme, API version, orientation or device name from the designer toolbar. MonoDevelop works fine.
Is there a resolution for this?
I have not seen one. There are other issues as well, if you modify a xaml file and change widows without saving it, your changes will disappear! While Monodroid is an awesome tool, there are still a few bugs

xml error in Eclipse after updating Android SDK Tools

This is the error I'm getting in my layout XML files:
error!
NotFoundException: null
Exception details are logged in Window > Show View > Error Log
The following classes could not be found:
- TextView (Change to android.widget.TextView, Fix Build Path, Edit XML)
This happened after updating my SDK tools in Eclipse. However, I can still compile my code, I just can't see the graphical part of my layout.
Recently, I also added the RootTools library, could that also be the cause?
Thank you!
I had the same problem. And it turned out to be a very strange thing.
In my strings.xml file I had a line
<string name="email_seperator_char">\#</string>
And this was causing the problem. Even if I use the escape character for # sign preview was not working after SDK update.
SOLUTION:
I just added a space in front of it and voila, it worked.
<string name="email_seperator_char"> \#</string>
I know it is strange and it may not be acceptable for some apps to have an space infront of it. But that was ok for my app. Hope this helps.
And in design mode, in graphical layout, you have a new icon, (android icon), click and select 8 minimum.
I'm not sure it helps in your case, but I found out what was the problem with mine. To support older Android devices, I lowered my project build target to API level 7 (Android 2.1) from the previous value of API Level 8 (Android 2.2).
There might be an issue with the 2.1 layout renderer, it kept crashing on my TextView's property android:textAppearance="?android:attr/textAppearanceMedium". Even when I removed it, rendering was working but had a strange appearance (grey background, tiny black text). Switching the API level back fixed the layout editor straight away.
To change it, go to your project properties, select Android on the right, then tick the box next to your desired API level under Project Build Target.
I ve got the same issue just a minutes ago, try to lower the API level, press the andorid green icon in the layout editor screen and on the dropdown menu select API 7. I think it would be work out.
I've been having similar issues. After reading a number of these posts, I've found that there is probably a bug in the layout renderer for Android 4.0.3. An error message is listed (ROOT
Exception details are logged in Window > Show View > Error Log) even when all parts of the project are set to Android 4.0.3 and SDK 15.
If I set the layout renderer to Android 2.2 and leave everything else set to Android 4.0.3, SDK 15, then it all appears to work just fine.
I hope this is useful.
there is something wrong in your TextView
one time I wrote this which cause the problem
android:textAppearance="#android:attr/textAppearanceLarge"
the Eclipse can`t tell that is wrong but the design view crashes,when I realized that,I change # to ?
android:textAppearance="?android:attr/textAppearanceLarge"
then all comes to normal

Downgrade SDK and build target android

I'm almost done with my app, and, i admit i made a mistake. I set the min build target a 2.3.1 at the begining and now, i want to downgrade it to 2.1 at least. Everything looks fine except in xml files. i got this :
error: Error: String types not allowed (at 'layout_width' with value 'match_parent').
My question is quite simple : anyone know how can i fix that ? I don't think minSDK 7 refuses the "match parent", but maybe i'm wrong.
Thanks in advance ;)
Change match_parent to fill_parent.
Try to use fill_parent instead of match_parent.Hope this will work for you.match_parent is replaced by fill_parent for some higher version(Exact version from which it is deprecated I don't know).
I tried in sdk 2.1 and match_parent is not working but in Google API 2.1 sdk match_parent is working so you can change the sdk version to Google API 2.1 and then test if it is working in real device if yes then match_parent will works fine otherwise change the match_parent to fill_parent
hope it will help!!

Categories

Resources