android - Failed to create a custumView and use its attributes -


i try create custom view.

attrs.xml

<?xml version="1.0" encoding="utf-8"?> <resources>     <declare-styleable name="clickedview">         <attr name="clicked" format="boolean" />     </declare-styleable> </resources> 

clickedview.java

public class clickedview extends view {      public clickedview(context context, @nullable attributeset attrs) {         super(context, attrs);     } } 

inside layout of choise -

<clickedview android:layout_width="match_parent"                                              android:layout_height="match_parent"                                              app:clicked="true"/> 

the problem cant use attribute defined - clicked, since 'app' unexpected namespace. should overcome problem?


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -