Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code completion does not work for External Library XML attributes (Android Studio)

I am using Android Studio 1.1 RC 1.

I've imported an external library into Gradle:

compile 'com.rengwuxian.materialedittext:library:1.8.3'

I've added the namespace tag:

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

into the parent as below:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/primary_light"
    android:orientation="vertical"
    android:padding="20dp"
    tools:context="net.xxx.xxx.ui.activities.Activity"/>

I get code completion for the custom views within the library i.e.:

<com.rengwuxian.materialedittext.MaterialAutoCompleteTextView />

But nothing comes up when I try code completion for the attributes for this view. I have to type all this in manually.

<com.rengwuxian.materialedittext.MaterialAutoCompleteTextView
    android:id="@+id/autocomplete"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:completionThreshold="3"
    android:hint="Enter name"
    android:imeOptions="actionDone"
    app:floatingLabel="normal"
    app:floatingLabelText="Find xxx"/>

Is there a setting or import that I'm missing?

Helpful Info: The attribute file in the library can be found here. https://github.com/rengwuxian/MaterialEditText/blob/master/library/src/main/res/values/attrs.xml

like image 783
SalicBlu3 Avatar asked Mar 08 '15 00:03

SalicBlu3


1 Answers

I had the same issue. But I have solved it. Go File > Invalidate Caches / Restart... > Click at Invalidate and Restart It's an efficient way. You can try.

Source: Android Studio - Auto complete and other features not working

Note: Here are some other approaches too. Have a look.

like image 52
Nadia Akter Avatar answered Oct 19 '22 00:10

Nadia Akter