Example usage for twitter4j Category getSlug

List of usage examples for twitter4j Category getSlug

Introduction

In this page you can find the example usage for twitter4j Category getSlug.

Prototype

String getSlug();

Source Link

Usage

From source file:com.klinker.android.twitter.adapters.CategoriesArrayAdapter.java

License:Apache License

public void bindView(final View view, Context mContext, final Category category) {
    final ViewHolder holder = (ViewHolder) view.getTag();

    holder.text.setText(category.getName());

    holder.text.setOnClickListener(new View.OnClickListener() {
        @Override/*from w w  w  .  j  a va 2  s  .co m*/
        public void onClick(View view) {
            Intent search = new Intent(context, PeopleSearch.class);
            search.putExtra("slug", category.getSlug());
            context.startActivity(search);
        }
    });

}

From source file:twitter4j.examples.suggestedusers.GetSuggestedUserCategories.java

License:Apache License

/**
 * Usage: java twitter4j.examples.suggestedusers.GetSuggestedUserCategories
 *
 * @param args message/*from   w w  w. j a v  a 2 s .c o  m*/
 */
public static void main(String[] args) {
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        System.out.println("Showing suggested user categories.");
        ResponseList<Category> categories = twitter.getSuggestedUserCategories();
        for (Category category : categories) {
            System.out.println(category.getName() + ":" + category.getSlug());
        }
        System.out.println("done.");
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to get suggested categories: " + te.getMessage());
        System.exit(-1);
    }
}