[android-beginners] Re: Error using graphics in XML-Based UI

2009-01-09 Thread Mark Murphy

coderguy89 wrote:
>android:layout_width="wrap_content"
>   android:layout_height="wrap_content"
>   android:src="@+drawable/eclipse"
> />

Do not use plus in android:src. It should be:

android:src="@drawable/eclipse"

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Error using graphics in XML-Based UI

2009-01-08 Thread coderguy89

Ok - nevermind; I realized the problem - the image was actually in the
wrong directory.

On Jan 7, 3:12 am, coderguy89  wrote:
> Is there a bug when using the XML ImageView to display graphics? I can
> display images fine using the ImageView class in
> androids.widgets.ImageView. But when trying to run an application that
> uses the XML ImageView to display images, my application crashes at
> start-up saying "The application [appname] has stopped unexpectedly.
> Please try again.".
>
> Code in Main Activity
>
>     public void onCreate(Bundle savedInstanceState)
>     {
>         super.onCreate(savedInstanceState);
>
>         setContentView(R.layout.main);
>     }
>
> Code In main.xml:
>
> 
> http://schemas.android.com/apk/res/
> android"
>     android:orientation="vertical"
>     android:layout_width="fill_parent"
>     android:layout_height="fill_parent"
>     >
>
>              android:layout_width="wrap_content"
>         android:layout_height="wrap_content"
>         android:src="@+drawable/eclipse"
>     />
>
> 
>
> In android:src 'eclipse' is an eclipse.png image.  I also tried
> android:src="@drawable/eclipse" with no success --- it won't even
> compile this way.
>
> Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---