Permalink
Browse files

onBlogChanged() is now called when all blogs are hidden

  • Loading branch information...
1 parent 52505eb commit ccc28968b8a9be6935d023530b7ff157d8d28cd0 @nbradbury nbradbury committed Feb 22, 2014
@@ -35,6 +35,8 @@ public void onCreate(Bundle savedInstanceState) {
}
private void loadSiteURL() {
+ if (mBlog == null)
+ return;
String siteURL = null;
Gson gson = new Gson();
Type type = new TypeToken<Map<?, ?>>() {}.getType();
@@ -548,6 +548,9 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (blogNames.length >= 1) {
setupCurrentBlog();
onBlogChanged();
+ } else {
+ // user has hidden all blogs
+ onBlogChanged();
}
WordPress.registerForCloudMessaging(this);
}
@@ -620,10 +623,10 @@ public void onClick(DialogInterface dialog,
}
/**
- * This method is called when the user changes the active blog.
+ * This method is called when the user changes the active blog or hides all blogs
*/
public void onBlogChanged() {
- WordPress.wpDB.updateLastBlogId(WordPress.currentBlog.getLocalTableBlogId());
+ WordPress.wpDB.updateLastBlogId(WordPress.getCurrentLocalTableBlogId());
// the menu may have changed, we need to change the selection if the selected item
// is not available in the menu anymore
Iterator<MenuDrawerItem> itemIterator = mMenuItems.iterator();

0 comments on commit ccc2896

Please sign in to comment.