kaushikgodhani / vocsy_epub_viewer

Apache License 2.0
29 stars 68 forks source link

Dual screen opening #61

Closed anil5387 closed 1 month ago

anil5387 commented 1 month ago

When I trying to open any epub file it is getting opened in new screen.

ListView.separated( itemBuilder: (BuildContext context, int index) { return ListTile( title: Text(itemTitle[index]), onTap: () async {

          MyRouter.pushPage(
              context,
              VocsyEpub.openAsset('assets/myepub.epub',
                      lastLocation: EpubLocator.fromJson({
                        "bookId": "2239",
                        "href": "/OEBPS/ch06.xhtml",
                        "created": 1539934158390,
                        "locations": {"cfi": "epubcfi(/0!/4/4[simple_book]/2/2/6)"}
                      }))
                  as Widget);
        },
        );
      },
      separatorBuilder: (BuildContext context, int index) {
    return Divider();
  }, 
      itemCount: itemTitle.length
      ),
  ),
);
rinkeshjain commented 1 month ago

Please check your AndroidManifest file if you're using taskAffinity android:taskAffinity, you need to remove it

Purpose of taskAffinity

Task Affinity: It defines which task an activity prefers to belong to. By default, all activities in an application have the same task affinity, which is the application's package name.

Custom Task Affinity: You can assign a different task affinity to an activity to make it start in a different task or to group certain activities together in a specific task.

anil5387 commented 1 month ago

Thank you so much @rinkeshjain it is working now.