0

I want to use a library to make drag and drop list view. It's named "drag-sort-list-view" After download this lib project,I created a project and I exported de libray folder in .jar, including the .classes and the xml dslv_attrs, containing the styleable. I can't compile with it. Look at my xml where i want to use the custom :

<?xml version="1.0" encoding="utf-8"?>
<com.mobeta.android.dslv.DragSortListView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:dslv="http://schemas.android.com/apk/res/com.mobeta.android.dslv"
    android:id="@android:id/list"
      android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    dslv:drag_enabled="true"
    dslv:collapsed_height="2dp"
    dslv:drag_scroll_start="0.33"
    dslv:max_drag_scroll_speed="0.5"
    dslv:float_alpha="0.6"
    dslv:slide_shuffle_speed="0.3"
    dslv:track_drag_sort="false"
    dslv:use_default_controller="true"
    dslv:drag_handle_id="@id/drag_handle"
    dslv:sort_enabled="true"
    dslv:remove_enabled="true"
    dslv:drag_start_mode="onDown"
    dslv:remove_mode="flingRemove" />

for the line xmlns:dslv , if I set my package project I have this kind of error :

error: No resource identifier found for attribute 'xxx' in package 

Every where i read it's the fix of the issue...

When I set the library project, like on the example, it compile and stop with this error in the logcat :

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.interfacevm/com.example.interfacevm.MainActivity}: android.view.InflateException: Binary XML 
                                  file line #2: Error inflating class com.mobeta.android.dslv.DragSortListView

I read that there 'is a fix for this issur in sdk 17, but it doesn't work for me. An idea ? Thanks a lot

Skartt
  • 551
  • 2
  • 7
  • 19

1 Answers1

1

It's just a guess, but try to replace the namespace with

xmlns:dslv="http://schemas.android.com/apk/res-auto"

That's how i import my libraries and that works fine.

SimonSays
  • 10,867
  • 7
  • 44
  • 59
  • The problem stay the same. Are your librairies define styleable ? – Skartt Sep 30 '13 at 08:12
  • Yes, the library contains custom styleables. Though, i'm not exporting it, but rather keep it as a project in eclipse. Try if that helps. Keep it as a project in eclipse, set the android library flag, reference it from your main project and run it. that should work. – SimonSays Sep 30 '13 at 17:27
  • Ah ok it was the situation I had at the beginning : two project, one named library. I want to export library in a .jar to add it in my launcher project, but I have the issue of the question. – Skartt Oct 03 '13 at 14:43