1

我在这里有一堂课,它会一一获取日历事件。使用 InputStream 和 HttpGet。这使得应用程序非常慢我怎样才能让它更快。我有以下代码,

List<ArrayList> event= getEvents(filter, urls,EmailShare)

    public List getEvents(Filter filter, String uri,List<String> emailShare){
        List eventsToday = null;
        for (String email : emailShare) {
            String uris = uri + email + "/events/";
            InputStream stream=httpGet(uris);
            BufferedReader br = 
                new BufferedReader(new InputStreamReader(stream));
            CalendarBuilder builder = new CalendarBuilder();
            calendar = builder.build(br);
            eventsToday = (List<?>) 
                filter.filter(calendar.getComponents(Component.VEVENT));
            arrayList.addAll(eventsToday);
        }
        return arrayList;
    }

InputStream行很慢。

4

0 回答 0