Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am working on following code, but "import android.support.v7.widget.Toolbar;" is not functioning ,
the ",Toolbar" gets red colored as if it is an error


I want to get it done
kindly get me through it


Java
import android.os.Bundle;
import android.view.View;

import android.support.v4.app.FragmentActivity;


import android.support.v7.widget.Toolbar;

import observableview.ObservableScrollView;
import observableview.QuickReturnHandler;

public class Main extends FragmentActivity {




    /**
     * Called when the activity is first created.
     */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Toolbar toolbar = (Toolbar) findViewById(R.id.my_toolbar);
        toolbar.setTitle("App Title");
        toolbar.setSubtitle("Subtitle");

        ObservableScrollView mObservableScrollView = (ObservableScrollView) findViewById(R.id.scroll_view);
        View placeholderView = findViewById(R.id.placeholder);

        QuickReturnHandler.setup(toolbar, placeholderView, mObservableScrollView);



    }}
Posted
Updated 2-Aug-15 19:09pm
v2
Comments
Richard MacCutchan 4-Aug-15 3:37am    
Check that you have the latest support libraries installed.
Member 11402033 4-Aug-15 5:15am    
i have all the support libraries and up to date
Richard MacCutchan 4-Aug-15 5:50am    
Sorry, but you will need to gather more information. It is impossible to guess what is missing, or not configured correctly.
Richard MacCutchan 4-Aug-15 8:08am    
I have been trying this myself and the Toolbar class does not appear to be in my copy of the library archive. Check again that you have all the latest libraries.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900