[英]android app shows a blank screen instead of the book list
https://github.com/kamaleshdas1997/BookListing2 https://github.com/kamaleshdas1997/BookListing2
here is the code.这是代码。 The app opens with a search bar (I didn't start working on search bar so search bar is not functional - let's say dummy search bar ) on button click it will redirect to another activity (BookListActivity.java) where from an API get a list of book to suppose to display on-screen instead of which it shows a blank screen.该应用程序以搜索栏打开(我没有开始在搜索栏上工作,因此搜索栏不起作用 - 假设是虚拟搜索栏)单击按钮它将重定向到另一个活动(BookListActivity.java),从 API 获得假设在屏幕上显示的书籍列表,而不是显示空白屏幕。
I don't know where it is going wrong.我不知道哪里出了问题。 As in logcat there is no error.与 logcat 一样,没有错误。
LogCat:-日志猫:-
2020-12-07 12:35:22.124 32007-32036/com.example.booklisting \
I/Adreno: QUALCOMM build : 365e321, I294de8bafa
Build Date : 01/08/19
OpenGL ES Shader Compiler Version: EV031.25.03.02
Local Branch :
Remote Branch : refs/tags/AU_LINUX_ANDROID_LA.UM.7.5.R1.09.00.00.464.040
Remote Branch : NONE
Reconstruct Branch : NOTHING
2020-12-07 12:35:22.124 32007-32036/com.example.booklisting \
I/Adreno: Build Config : S L 6.0.7 AArch64
2020-12-07 12:35:22.124 32007-32036/com.example.booklisting \
D/vndksupport: Loading /vendor/lib64/hw/gralloc.msm8996.so from current namespace instead of sphal namespace.
2020-12-07 12:35:22.132 32007-32036/com.example.booklisting \
I/Adreno: PFP: 0x005ff110, ME: 0x005ff066
2020-12-07 12:35:22.146 32007-32036/com.example.booklisting \
I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
2020-12-07 12:35:22.147 32007-32036/com.example.booklisting \
I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
2020-12-07 12:35:22.148 32007-32036/com.example.booklisting \
I/OpenGLRenderer: Initialized EGL, version 1.4
2020-12-07 12:35:22.148 32007-32036/com.example.booklisting \
D/OpenGLRenderer: Swap behavior 2
2020-12-07 12:35:22.205 32007-32036/com.example.booklisting \
D/vndksupport: Loading /vendor/lib64/hw/android.hardware.graphics.mapper@2.0-impl.so from current namespace instead of sphal namespace.
2020-12-07 12:35:22.207 32007-32036/com.example.booklisting \
D/vndksupport: Loading /vendor/lib64/hw/gralloc.msm8996.so from current namespace instead of sphal namespace.
2020-12-07 12:35:30.716 32007-32007/com.example.booklisting \
W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@2cdc1a2
You are missing the init call to the loader API.您缺少对加载程序 API 的初始化调用。 Add this添加这个
LoaderManager.getInstance(this).initLoader(1, null, this);
in the onCreate function of在 onCreate function 的
BookListActivity.class
everything else looks good. BookListActivity.class
其他一切看起来都不错。
NB: Make sure you are not using the deprecated API.注意:确保您没有使用已弃用的 API。 the one above is from AndroidX.上面的一个来自AndroidX。 getLoaderManager().initLoader(1, null, this)
this will be for older API's. getLoaderManager().initLoader(1, null, this)
这将用于较旧的 API。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.