-1

I added a new Progress bar lib to my project. I added it through the maven. Then i used the progress bar in my layout file. While running the App it shows this Error.

 Caused by: android.view.InflateException: Binary XML file line #15: Error inflating class com.github.castorflex.android.circularprogressbar.CircularProgressBar

This is the Library i am using https://github.com/castorflex/SmoothProgressBar.

My layout File

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity"
    tools:ignore="MergeRootFrame">

    <ListView
        android:id="@+id/feed_list"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <com.github.castorflex.android.circularprogressbar.CircularProgressBar

        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:indeterminate="true"
        android:id="@+id/progressBar"
        app:cpb_color="#FFee44"
        app:cpb_colors="@array/colors"
        app:cpb_rotation_speed="1.0"
        app:cpb_sweep_speed="1.0"
        app:cpb_stroke_width="4dp"
        app:cpb_min_sweep_angle="10"
        app:cpb_max_sweep_angle="300"
        />
</FrameLayout>

My Class

public class VideoActivity extends Activity {

    private static final String TAG = "Mine";


    private static final int REQ_START_STANDALONE_PLAYER = 1;
    private static final int REQ_RESOLVE_SERVICE_MISSING = 2;

    public static final String DEVELOPER_KEY = "AIzaSyDcnoqJGI1872s";

    public ListView listView;
    private FeedListAdapter listAdapter;
    private List<FeedItem> feedItems;
    public String mvideoid;
    public String mstatus;
    ProgressBar progressBar;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_feed_list);
        progressBar = (ProgressBar) findViewById(R.id.progressBar);
        progressBar.setVisibility(View.VISIBLE);
        listView = (ListView) findViewById(R.id.feed_list);
        feedItems = new ArrayList<FeedItem>();
        listAdapter = new FeedListAdapter(this, feedItems);
        listView.setAdapter(listAdapter);

         // making fresh volley request and getting json
        GsonRequest<FeedResult> gsonRequest = new GsonRequest<FeedResult>(URL_FEED, FeedResult.class,
                new Response.Listener<FeedResult>() {
                    @Override
                    public void onResponse(FeedResult response) {
                        feedItems = response.getFeedItems();
                        listAdapter.setData(feedItems);
                        listAdapter.notifyDataSetChanged();
                        progressBar.setVisibility(View.INVISIBLE);
                    }
                },
                new Response.ErrorListener() {
                    @Override
                    public void onErrorResponse(VolleyError error) {
                        Log.d(TAG, "Error: " + error.getMessage());
                    }
                });


        // Adding request to volley request queue
        AppController.getInstance().addRequest(gsonRequest, TAG);
        getid();
    }
}
AruLNadhaN
  • 2,808
  • 5
  • 24
  • 42

2 Answers2

1

Try to replace with this :

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

this value (com.android.demo) replace with your package name.

Haresh Chhelana
  • 24,720
  • 5
  • 57
  • 67
  • It shows Error:(14) No resource identifier found for attribute 'cpb_color' in my package – AruLNadhaN Oct 21 '14 at 06:35
  • @Haresh Chhelana : don't you think its wrong that he is using default progressBar whereas in xml he is using some custom CircularProgressBar thing. so that's the major coding error too? – MOSO Oct 21 '14 at 06:39
0

if you are using any custom component refer it with the same name i.e.

 import com.github.castorflex.android.circularprogressbar.CircularProgressBar;


    public class VideoActivity extends Activity {

     CircularProgressBar progressBar; 
    .
    .

      @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_feed_list);
            progressBar = (CircularProgressBar) findViewById(R.id.progressBar);
    .
    .
    .

you are using the default one which isn't present in xml

MOSO
  • 393
  • 2
  • 9
  • have you checked its in your build path? – MOSO Oct 21 '14 at 05:59
  • hmmm follow this http://stackoverflow.com/questions/16588064/how-do-i-add-a-library-project-to-the-android-studio I hv never worked in this IDE however once you are done with this you'll have your code working. – MOSO Oct 21 '14 at 06:09