1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-05 10:49:24 +02:00

single NetworkLibraryActivity instance is now used

This commit is contained in:
Nikolay Pultsin 2011-08-15 02:13:52 +01:00
parent 364e191be1
commit 469525664d
9 changed files with 50 additions and 36 deletions

View file

@ -242,10 +242,14 @@ abstract class Util implements UserRegistrationConstants {
static void openTree(Context context, NetworkTree tree) {
final Class<?> clz = tree instanceof NetworkBookTree
? NetworkBookInfoActivity.class : NetworkLibraryActivity.class;
context.startActivity(
new Intent(context.getApplicationContext(), clz)
.putExtra(NetworkLibraryActivity.TREE_KEY_KEY, tree.getUniqueKey())
);
if (context instanceof NetworkLibraryActivity && clz == NetworkLibraryActivity.class) {
((NetworkLibraryActivity)context).openTree(tree);
} else {
context.startActivity(
new Intent(context.getApplicationContext(), clz)
.putExtra(NetworkLibraryActivity.TREE_KEY_KEY, tree.getUniqueKey())
);
}
}
public static NetworkTree getTreeFromIntent(Intent intent) {