I am building an app to help you keep track of tv-shows.
When i first add my "widget" to dashclock the notification appear if there is any, but after a while they disappear again.
The code for my activity extending DashClockExtension
@Override
protected void onUpdateData(int reason) {
DatabaseHandler databaseHandler = new DatabaseHandler(this);
ArrayList<Episode> episodes = databaseHandler.GetTodaysEpisodes();
DateHelper dateHelper = new DateHelper();
String numberOfEpisodes = "" +episodes.size();
StringBuilder sb = new StringBuilder();
for (Episode episode : episodes) {
sb.append(dateHelper.Episodenumber(episode) + " " + episode.getTitle() + "\n");
}
publishUpdate(new ExtensionData()
.visible(true)
.icon(R.drawable.ic_icon_dashclock)
.visible(!numberOfEpisodes.equals("0"))
.status(numberOfEpisodes)
.expandedTitle(numberOfEpisodes + " episodes airing today")
.expandedBody(sb.toString())
.clickIntent(new Intent("se.ja1984.twee.CalendarActivity_LAUNCH_IT"))
);
}
Since my data isn´t updated that often I´m satisfied with letting DashClock check for updates.
I´m new to android development and are probably doing something wrong :) And I would really appreciate someone pointing me in the right direction!