Android Manifest: configChanges:screenSize is not available - android

I have strange issue. And normally on strange issues I've done something really stupid. But this I have absolutely no clue what could be wrong.
I added
android:configChanges="orientation"
to the activity section of my app to prevent the refresh of the listview on screen rotation. This worked pretty well, but after targeting sdK-Version 15, the ListView is refreshing again. I read some more lines and noticed, that I also have to add screenSize attribute for sdK targets 13 and above.
But there is no attribute "screenSize" available in my Eclipse (smallestScreenSize is also missing). I have installed every available sdK incl the Google api's since Version 7.
Please has someone an idea, how to fix that?
Thank u very much in advance!
Best regards
Tobi

Right click your Android Project, click Properties, navigate to Android, and then select Android 4.0.3. If you haven't already.
If screenSize and smallestScreenSize still don't show up, then doing a Project --> Clean and restarting eclipse. Not sure what the problem would be otherwise...

Related

ConstraintLayout doesn't match with the screen size

I just started my first Android Studio project and I already come with a problem :)
I search on google for the answer but didn't find my problem.
So I need your help please ^^
I download the last version of Android Studio, create a project with an Empty Activity and I came up with this
As you can see my ConstraintLayout is really small and I just can't work with this.
I didn't touch anything on the project. Just to be sure I create 3 projects that have the same issue and redownload 4 time Android Studio.
On the virtual Devices, it looks correct throw: Screenshot
I put the XML code just in case it can help
xmlcode
Hope I was clear and sorry for my English ;)
EDIT: For some reason, the constraint layout fit correctly on the watch screen, but I don't want to create a watch app x) screenshot_watchview
Ok so I have finally find the problem ! I'm so happy right now :D
The problem was the AppTheme theme that I use, I switch it with the DeviceDefault theme. I don't know why this theme was causing problem but now it work and I can finally work on my first Android App !
If you are using the supportLibrary 28+ then this thing happened to me too.
and when I change the support lib version to the 27, it works.
Maybe this is a possible bug in the support library 28+.
Changing the AppTheme works like a charm if you want to stick with the support library 28+ But if you still don't want to so Try using the support library below 28.

Strange Lint-errors in Android project

since I updated my Android SDK today I get some strange Lint errors in my project. The activity contains amongst others a textview. Everything works fine, but if I want to change the text size of the view within the code with .setTextSize(float size), I get in other lines (and also other independent methods) errors that a call requires a certain API level. But that are calls like string.isEmpty(), which is available since API level 1.
What am I missing? And I know, I can set the text size also in the xml-file, but I want to change it during runtime.
Any ideas?
Thanks!
Best regards
Tobi
I think I got into something similar some time ago (nonsense Lint errors)...
Are you working with Eclipse?
If so, you can try the following:
Restart Eclipse
Clean your project (Project->clean...)
Click the button "Runs Android Lint..." (it's in the toolbar, between the "Virtual device manager" and the "new project wizard")
I don't remember exactly what did I do to solve the problem, I hope it works though
Good luck!
With the latest release, I've had a few times where the lint errors were just incorrect. (missing semicolon on a line with a semicolon, etc).
In such cases, you can right-click on lint error warning, or on the numberings on the left side, and select "Clear All Lint Markers".
This will allow you to compile the file once, and if that works, Lint seems to start acting normally again.

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

Eclipse hangs while changing properties [duplicate]

Like the question says, no mater what project i try this on, old or brand new, when I right click on the project and go to properties, then select the Android tab (I want to add a library), Eclipse freezes. I have to kill it. Has anyone run into this problem or know how I might fix it?
Thanks
EDIT:
Eclipse SDK
Version: 3.6.2
Build id: M20110210-1200
EDIT:
Or is there another way to add a library. I want to try out ActionbarSherlock :)
Ok, so I don't claim to understand it, but I've tried it more than once and confirmed it. When I'd go to the Android tab in Properties, the window automatically stretches the full height of my monitor and freezes. So, I killed it and went back in, but this time, starting on a different category ("Resource" in this case), I squashed the window height down to almost as small as it could get and clicked on Android. It worked. Didn't freeze. Then I was able to expand the window to see the list of libraries. No idea what it is, but I did it several times...recreating the freeze and then the fix. Hopefully this will save someone else...
i have found the reason ,because the list of available Android sdk is too long ,the window of the property can't be drawn immediately ,so it has no response.
the solution is open the SDK Manager ,delete the old sdk platform ,such as 1.5 1.6 3.0 3.1 3.2
those are not used usualy.then restart the eclipse .it works now .
For these kind of problems you have to try the following (in the same order) and stop when it works.
Play around inside eclipse by closing and opening project, deleting and reimporting projects etc.,
Restart eclipse
Restart system
Upgrade to the latest android SDK
Upgrade to the latest eclipse version
Usually you should stop at 2. Sometimes you need to stop at 3. Occasionally at 4 and Rarely at 5.
Good luck.

Blank Graphical Layout?

I don't get this. I've searched everywhere and no one's answers have solved this for me.
Why does this keep happening? I can't do anything! The XML Code is still there, but it doesn't show anything in the Graphical Editor. The Palette comes up if I change it to "4in WVGA (Nexus S)" or some other configuration, but I still can't see anything and the Theme drop down menu is unselectable. All my XML documents are like that.
Just delete any custom device screen configuration you have added . It will solve the issue :)
That just happen to me and after some attempts I found the reason.
When I first opened the project in eclipse I found some errors related with the version of Java. I changed the JDK compliance to 1.6 (Project->Properties->Java Compiler) and all errors dissapear but all graphical layouts went blank.
I uncheked "Enable project specific settings" (Project->Properties->Java Compiler) and now all the graphical layouts are working.
When everything fails, close eclipse and start it all over again, it solved my problem.
I also had that problem, it happened to me when i imported my project. after some time I came to reason just change the workspace of eclipse to folder, which contains your folder.
I changed workspace on opening eclipse, there can be some other way as well
hope this will solve it
If it has never worked for you (or something went wrong upgrading your SDK, as in my case), you may need to install an extra package. For me the issue was fixed when I installed Android Native Development Tools under NDK Plugins (SDK version 20).
I had this problem since I switched the option Show previews in the palette. I switched to show only icons, everything is ok now.

Categories

Resources