Google calendar widget not getting displayed in home screen i developed

  • Replies:0
  • OpenNot stickiedUnanswered
  • Forum posts: 1

Jan 7, 2015 4:37:11 AM via Website

Hi,

I am trying to show google calendar widget in my home screen . The widget is not getting displayed properly in the homescreen(only plain blue bar i am able to see). Can any one please help. please find the below code.i am not sure what i am missing,

if(info.provider.getPackageName().equals("com.google.android.calendar")){
if(info.label.equals("Calendar")){
if(IsCalendarVisible == false) {
int appWidgetId = mAppWidgetHost.allocateAppWidgetId();
LinearLayout calendarlayout = (LinearLayout) findViewById(R.id.layoutClockWeather);
AppWidgetHostView AppHostView = mAppWidgetHost.createView(this, appWidgetId, info);
AppHostView.setAppWidget(appWidgetId, info);
calendarlayout.addView(AppHostView);
IsCalendarVisible = true;
mAppWidgetHost.startListening();
}
}
}

thanks!