简体   繁体   中英

How to display installed apps without using ListView/RecyclerView/CardView etc in Android?

I have an application that lists in a RecyclerView all apps installed in the Android device.

I would like to select them, and then press a button to open a new activity that will show all the apps I have selected.

But I do not want another listview/recycle view, I want then to be displayed just like they are in the home screen: the icon with the name under it, side by side, etc… Just like it is in any android device. And they should be able to be open as well.

I really have no idea how to display them in this way in the new activity. I am using java.

To resume, I am trying to develop a kind of Kiosk app, where access to the apps could be controlled.

Any tips will be appreciated. Thanks!

you want to display all the applications in a grid manner just like android default home page, You can use RecyclerView with GridLayoutManager as following code do

val numberCol=4

val gridLayoutManager = GridLayoutManager(this,numberCol)

mRecyclerView.setLayoutManager(gridLayoutManager)

adapter = ViewAdapter(mlist)

mRecyclerView.setAdapter(adapter)
  • you can launch the corresponding app on item click. I hope it will help you!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM