Android how to remove gridlayout from the project? - android

I added grid layout to my project at the start and eclipse added a bunch of stuff. Now, though I am not using this layout. I want to remove it.
I can see the following from my properties file:
target=android-18
android.library.reference.1=../gridlayout_v7
When I remove the line
android.library.reference.1=../gridlayout_v7
I get compile errors relating to my R.java class.
I cannot seem to find a proper way to remove this package. Anybody knows how to do this?
Thanks!

#Nightshadow please right click on project and select properties and then select android now you will able to see Library pane in below area from there you can remove grideview layout library

Related

Constraint line is not working in design view

Please click on this link for the image:
Second image for new project:
Please see Image above. I have added many button/view to the layout. But there is no constraint line/ alignment line that I used to see when I add new items to the layout. Also, I don't see my view/button show up in the design view.
What is wrong? How can I fix this. So, I can design my layout quickly in the design view?
One note, when I create the first app project. I suppose to see the word "Hello world" in the middle, but I didn't see it this time also
Clean and rebuild your project then you will be able to see it, the problem occurred because your code contained some error when it was building so building failed and android studio don't show preview if that happens.
Cleaning and rebuilding will solve your problem

Android: Trying to use a inbuilt layout xml file - simple_list_item_2_single_choice symbol cannot be resolved

I'm trying to create a listview where each item in the listview has two lines of text and a radio button at the end, so you can select one of the items in the list and then click next.
simple_list_item_2_single_choice.xml does exactly this, and it is integrated into android.
I have already used simple_list_item_2 which is built in for android on another screen without problems, and I can see that simple_list_item_2_single_choice is in
...\android-studio\sdk\platforms\android-20\data\res\layout
but when I try to reference it in my code, I get the error: cannot resolve symbol 'simple_list_item_2_single_choice'
Does anyone know how to make my app recognize this inbuilt file?
Does anyone know how to make my app recognize this inbuilt file?
Step #1: Copy the file into your app project.
Step #2: Reference your copy from your Java code.
While that layout file may be part of Android, it is not part of the Android SDK, as you will not see that resource listed in the android.R.layout package.

Know if resource image is used

Is there any quick way to know if an image is referenced or used in a Java class or XML layout? For example like if an image.9.png is used in a certain layout. Thanks.
in Eclipse you cam make Search Like below Step .
First Click your Current Project in which you would like to Search .
Now Press Ctrl+H in windows that will open Search Dialog Window.
Now you want to check bg.png used in your Project ,Search like below in
#drawable/bg
This will search for all Layout and xml file which use this image.
Now for Search in java file you need to search with it's id which you give in xml file.
R.id.yourimageId
Now in your case you can search your #drawable/image by Ctrl+h Dialog in Eclipse.
EDIT In ADT updated version Like ADT 16 we have lint tool it will give all warning for unused Resource .
Issue: Looks for unused resources
you will find this warning in lint check .
for More about Lint Refer this Link Lint Checker SO
There's no way to do it via code. However, in Eclipse, if you delete the image (make sure you make a copy first) and build the project, you'll know the spots where you are missing it :)

What is the component name of the following image?

Can you people see the common icon at the left of this list . If we hold and drag that icon then we can manually arrange the list. I want to know the name of this component and any example links (if available) to achieve this.
Thanks,
Its drag and drop list view you can find and example
http://ericharlow.blogspot.com/2010/10/experience-android-drag-and-drop-list.html
This project code is simply to share a simple working drag and drop list since I was unable to find one elsewhere on the web. If you add any extensions to this simple project I would like to hear about it in the comments.
or
You can also try Mark Murphy's
https://github.com/commonsguy/cwac-touchlist
To work with TouchListView in your own project, place the library project somewhere and update your project to reference the library project (via Eclipse, via android update lib-project, etc.). Then, add a com.commonsware.cwac.tlv.TouchListView widget to your XML layout file.

Where is the Visual Editor for Eclipse with the ADT plugin

I thought ADT should come with a visual editor for building GUI : Easy way to build Android UI?
However, I just cannot find it. I was wondering where is the Visual Editor for Eclipse with the ADT plugin.
I can run HelloWorld application without problem. However, whenever I click on main.xml at the left navigation tree layout folder, here is what I get. What I wish to get is a WYSIWYG editor.
Select your main.xml file. At the bottom of eclipse you can see a Layout tab, click on it and eclipse will open the android gui editor.
As Paul Kearny previously noted, to resolve issue with seeing "Design" tab instead of "Graphical Layout" follow these 2 steps:
1) Delete project from the left of the screen, without deleting the source files
2) File -> Import -> Existing Projects into Workspace, browse and select your workspace folder and open your project
Graphical Layout problem fixed!
If you want to edit the layout visually, rather than through XML, click on the Layout tab at the bottom left of the main.xml window (in your screenshot, just above Problems).
Also note, there are issues with displaying some of the widgets. For example, the ListView does not render. So, my hint is to change ListView to just a View, then work out the details of the layout so you can get the colors, relative-ness, etc. Then switch it back to ListView. There is one other widget that I cannot recall off the top of my head ...
To resolve issue with seeing "Design" tab instead of "Layout" or "Graphic Layout", I had to:
1. Delete the project from Eclipse without deleting the source
2. Shut down and restart Eclipse
3. Import the project back in
You could probably skip step 2, but I did it just to make sure.
Hope this helps anyone else who has the same issue.
If your view is showing Design|Source for the .xml file right click on the main.xml and select open with - android common XML editor. Simple.
If it is happening to one particular xml, you can delete the file (make sure you copy the content first), create new xml and paste the content again.
I recommend that any serious Android developer stay far, far away from Eclipse/ADT Design View. This is a time-wasting tool that sorely lacks the attention it would need from Google to make it worth serious consideration. It doesn't render the views as a real device would. There is no way to bind dynamic data. Does it work with fragments (I think not)? For it to work properly and have useful features would weigh down Eclipse further and make it unacceptably slow. In my very humble opinion, the entire strategy for ADT's ui-design tools has failed.
Thus, the recommendation is: edit Android XML layout files by hand and use the only reliable testing mechanism you have for layouts: actual devices. You can always fallback on the emulator - but the emulator performs 50x - 100x slower than an actual device. I'm not exaggerating. Pick your poison!
new fix, took me forever to get this fixed, really simple....delete the xml file and undo the deletion (ctrl+z), double click and there you go. Hope this helps someone as it did me. No shut down required.
If you see "Design" tab instead of "Graphical layout", just close the project and open it again.

Categories

Resources