I downloaded sample android carousel demo source code in the below link http://www.codeproject.com/Articles/146145/Android-3D-Carousel#xx4884593xx
The main.xml is as follows:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:pj="http://schemas.android.com/apk/res/carousel.main"
xmlns:bm="carousel.main"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/back"
android:orientation="vertical" >
<TextView
android:id="#+id/selected_item"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="0.5"
android:background="#1E1921"
android:text="text"
android:textColor="#A85E4F"
android:textStyle="normal"
android:visibility="gone" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="0.5"
android:gravity="top"
android:padding="5dip" >
<carousel.Carousel
android:id="#+id/carousel"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:animationDuration="200"
pj:Items="#array/entries"
pj:SelectedItem="0"
pj:UseReflection="true" />
</LinearLayout>
</LinearLayout>
However I'm now getting the following errors:
Description Resource Path Location Type
error: No resource identifier found for attribute 'UseReflection' in package 'carousel.main' main.xml
Suspicious namespace: should start with http:// main.xml
Each time I try and clean the project it deletes the R.file. I've tried changing the package name, and pasting all the contents again but that hasn't solved the problem.
I found where the problem was.
In the root of the xml:
xmlns:pj="http://schemas.android.com/apk/res/package_with_calling_class"
xmlns:bm="package_with_calling_class"
package_with_calling_class = the class which might be the main activity where the onCreate() is being called. In my case it was platinum.platinumstars
setContent(R.layout.main)
Related
I am trying to put a ViewAnimator above a button in RelativeLayout but it does not let me. Here is the code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ViewAnimator
android:id="#+id/show_picture_animator_VA"
android:layout_alignParentTop="true"
android:layout_above="#id/show_picture_hold_BTN"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</ViewAnimator>
<Button android:id="#+id/show_picture_hold_BTN"
android:text="HOLD"
android:textColor="#000000"
android:background="#drawable/hold_button_shape"
android:layout_width="#dimen/show_picture_hold_button_widht"
android:layout_height="#dimen/show_picture_hold_button_height"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"/>
</RelativeLayout>
This gives me this error:
Error:(7, -1) android-apt-compiler: [] --\res\layout\show_picture.xml:7: error: Error: No resource found that matches the given name (at 'layout_above' with value '#id/show_picture_hold_BTN').
Can someone please help me :)
Ids are added in the order they are listed (the ones with the #+id values). show_picture_hold_BTN is defined (android:id="#+id/show_picture_hold_BTN") after it as referenced in the ViewAnimator.
Since this is a relative layout, the align values are what order them visually; swap the order of the two views in XML and you're good.
<Button
android:id="#+id/show_picture_hold_BTN"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:text="HOLD"
android:textColor="#000000" />
<ViewAnimator
android:id="#+id/show_picture_animator_VA"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="#id/show_picture_hold_BTN"
android:layout_alignParentTop="true">
</ViewAnimator>
I am Developing an application that consists of a gauge view. I found code from here https://github.com/CodeAndMagic/GaugeView
I am getting an error of No resource identifier found forattribute'showOuterShadow' in package
'org.codeandmagic.android.gauge.demo. I added the library in the java build path of the project but it was still occurring please help me to solve this this is my xml code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gauge="http://schemas.android.com/apk/res/org.codeandmagic.android.gauge.demo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
android:background="#drawable/background"
android:padding="20dp" >
<org.codeandmagic.android.gauge.GaugeView
android:id="#+id/gauge_view1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<org.codeandmagic.android.gauge.GaugeView <!--Error occurring here-->
android:id="#+id/gauge_view2"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_marginTop="10dp"
gauge:showOuterShadow="true"
gauge:showOuterRim="false"
gauge:showNeedle="false"
gauge:showRanges="false"
gauge:showText="true"
gauge:textUnit="%" />
</LinearLayout>
This is so ridiculous to answer my own question:
i didn't add the library in my android project that is
YOUR PROJECT->RIGHTCLICK->POPERTIES->ANDROID->CLICK "ADD"->SELECT LIBRARY->CLICK "APPLY"->CLICK "OK"->RUN YOUR PROJECT
I've been trying to get this widget working in my Android project: https://code.google.com/p/android-coverflow/source/browse/
It's called Coverflow, and it kind of replaces the old Gallery widget. Implementing it seemed pretty straightforward until I got the error:
08-16 17:33:08.289: E/AndroidRuntime(15031): Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class pl.polidea.coverflow.CoverFlow
This is the XML file the error is referring to:
<pl.polidea.coverflow.CoverFlow class="pl.polidea.coverflow.CoverFlow"
android:id="#+id/coverflow"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip" >
</pl.polidea.coverflow.CoverFlow>
This question has been asked before on StackOverflow but the answer given here: Android coverflow : Error inflating class pl.polidea.coverflow.CoverFlow didn't work for me.
You should Use by this way:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<view class="pl.polidea.coverflow.CoverFlow" xmlns:coverflow="http://schemas.android.com/apk/res/pl.polidea.coverflow"
coverflow:imageWidth="100dip" coverflow:imageHeight="150dip" android:id="#+id/coverflow" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_marginTop="5dip">
</view>
<pl.polidea.coverflow.CoverFlow xmlns:coverflow="http://schemas.android.com/apk/res/pl.polidea.coverflow"
coverflow:imageWidth="100dip" coverflow:imageHeight="150dip" coverflow:withReflection="true"
coverflow:imageReflectionRatio="0.2" coverflow:reflectionGap="2dip" android:id="#+id/coverflowReflect"
android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="5dip" />
<TextView android:text="STATUS" android:layout_width="fill_parent" android:layout_height="wrap_content"
android:padding="5dip" android:id="#+id/statusText"></TextView>
</LinearLayout>
Make sure that "pl.polidea.coverflow.CoverFlow" is your class file(package+java class)...
Else replace "pl.polidea.coverflow.CoverFlow" in your xml with your actual class file having coverflow!!
I changed in eclipse background of layout and added new view (button).
I started my application but in emulator nothing changed!
What can I make? Mayby it's an Eclipse bug?
I downloaded this project from internet. Initially it had black background.
I added new View - all was OK.
But after I started changed background - and appeared this bugs
XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#android:color/white"
android:orientation="vertical" >
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
<EditText
android:id="#+id/txtInd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10" >
<requestFocus />
</EditText>
<ListView
android:id="#android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</ListView>
</LinearLayout>
Whenever you want to test the app again, DO NOT click on your app's icon in the emulator. However, select your project, and click on
IF this doesn't work. Try cleaning your project from : Project >>> Clean
'<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/droid_background" >
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_horizontal"
android:text="#string/hello"
android:textColor="#FFFFFF"
android:textStyle="bold" />
<GridView
android:id=”#+id/videoGrdVw”
android:layout_width=”fill_parent”
android:layout_height=”fill_parent”
android:numColumns=”auto_fit”
android:verticalSpacing=”5dip”
android:horizontalSpacing=”5dip”
android:columnWidth=”80dip”
android:stretchMode=”columnWidth”
android:gravity=”center”/>
</RelativeLayout>
You've got fancy quotes mixed in with regular plain old quotes - replace the ”s with "s and it should work.
It looks like there's a strange problem with the quotes that you've posted. Some of them are of a different type than the others - look at the ones in the GridView. I would try changing them to be the same as the quotes up above and see if that helps.