Custom View Subclass - How do I properly specify xmlns in my layout.xml file?

by Mark Rosenberg » Mon, 06 Apr 2009 13:23:46 GMT


Sponsored Links
 I am following the LabelView.java and associated custom_view_1.xml
layout files to guide me, but I am perplexed by the xmlns:app
specification. My custom view is in the com.foo.bar package. What do I
specify as the xmlns:app value to properly bind my XML layout
declarations to the attribute set my custom view constructor
processes?

I've tried xmlns:app="com.foo.bar", xmlns:app="http://
schemas.android.com/apk/res/com.foo.bar", xmlns:app="http://
schemas.android.com/com.foo.bar" to no avail.

Its not clear to me why the api example uses an http: scheme in the
first place. Shouldn't the package name be adequately unique?
--~--~---------~--~----~------------~-------~--~----~



Custom View Subclass - How do I properly specify xmlns in my layout.xml file?

by Mark Rosenberg » Mon, 06 Apr 2009 14:00:20 GMT


 Must be tired ... forgot to refresh or something ... xmlns:app="http://
schemas.android.com/apk/res/com.foo.bar" does the trick.

On Apr 5, 10:23pm, Mark Rosenberg <markrosenberg01460...@gmail.com>


--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Custom View Subclass - How do I properly specify xmlns in my layout.xml file?

by mawei1981 » Sat, 11 Apr 2009 00:49:39 GMT


 I thought you are not read the Dev Guide clear


you can define like the follow code


-----------------------------------------------------
 <com.foo.bar android:id="@+id/parameterName"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</com.foo.bar>

-----------------------------------------------------------
Done.

Good Luck.


On 4 13 Mark Rosenberg <markrosenberg01460...@gmail.com>


--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. ERROR/MediaPlayer(1066): setDataSource called in state 128

Hi, guys.

I'm using MediaPlayer and sometimes when first audio is about to end
and I click to the next audio I get the exception below. Looks like
the MediaPlayer is in some weird state of stopping playing and cannot
accept audio at the moment.

The exception goes to the native code which is greeks to me.
I couldn't find anything about this error on the internet either.

Is anyone here familiar with the problem?

Thank you in advance!

04-07 20:19:35.855: ERROR/MediaPlayer(1066): setDataSource called in
state 128
04-07 20:19:35.855: ERROR/AudioPlayerService(1066): Unable to play
chapter audio
04-07 20:19:35.855: ERROR/AudioPlayerService(1066):
java.lang.IllegalStateException
04-07 20:19:35.855: ERROR/AudioPlayerService(1066):     at
android.media.MediaPlayer.setDataSource(Native Method)
04-07 20:19:35.855: ERROR/AudioPlayerService(1066):     at
com.tourizo.android.services.AudioPlayerService.playResource
(AudioPlayerService.java:291)
04-07 20:19:35.855: ERROR/AudioPlayerService(1066):     at
com.tourizo.android.services.AudioPlayerService.access$3
(AudioPlayerService.java:287)
04-07 20:19:35.855: ERROR/AudioPlayerService(1066):     at
com.tourizo.android.services.AudioPlayerService$1.playCurrentChapter
(AudioPlayerService.java:89)
04-07 20:19:35.855: ERROR/AudioPlayerService(1066):     at
com.tourizo.android.services.AudioPlayerRemoteInterface$Stub.onTransact
(AudioPlayerRemoteInterface.java:99)
04-07 20:19:35.855: ERROR/AudioPlayerService(1066):     at
android.os.Binder.execTransact(Binder.java:276)
04-07 20:19:35.855: ERROR/AudioPlayerService(1066):     at
dalvik.system.NativeStart.run(Native Method)

--~--~---------~--~----~------------~-------~--~----~

2. How Google Can Save Android From Certain Failure

> Does this mean that the downloading app (in this case an application

Why?

I admit to not being totally in tune with the whole OTA space, but when I
read hackbod's initial contribution on this thread, my thought was "Damn!
The Android team just simplified Mr. Isbell's life!".

If an HTTP download is sufficient to trigger an app install, why isn't
SlideME just an awesome mobile-friendly Web site serving as an apps
directory (with integrated ecommerce and all that)? Why go through the
headache of somehow getting people to install your client component?

I'm probably just missing something...

--
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.2 Published!



--~--~---------~--~----~------------~-------~--~----~

3. Can an Italian company sell apps directly?

4. String->Integer Hashmap alternative

5. Google Groups compatibility with Android's browser

6. How to determine the amount of characters that will fit into a TextView

7. How to use AutoCompleteTextView with SimpleCursorAdapter