0

I am beginner in Android and want get Twitter trends, but getting a null value in trends. I don't understand where I made a mistake.

List<Trends> list; Trends trends; private Twitter mTwitter;

public  List<Trends>getDailyTrends(Date date, boolean excludeHashTags){
    try{
        list = mTwitter.getDailyTrends(date, excludeHashTags);
        Log.d("ab to aaja<><><><><>", ""+list);
    }catch (TwitterException e)
    {
        e.printStackTrace();
    }
    return list;

}
Specur
  • 3,240
  • 4
  • 23
  • 25

1 Answers1

0

Try this :

   public  List<Trends>getDailyTrends(Date date, boolean excludeHashTags){
        List<Trends> auxList = new ArrayList<Trends>;
        try{
            auxList = mTwitter.getDailyTrends(date, excludeHashTags);
            Log.d("ab to aaja<><><><><>", ""+list);
        }catch (TwitterException e)
        {
            e.printStackTrace();
        }
        return auxList;
    }

this.list = getDailyTrends(new SimpleDateFormat("yyyy-MM-dd").parse("2012-07-14"), true);

Also check if auxList is not null

Filipe Batista
  • 1,862
  • 2
  • 24
  • 39