本周早些时候,我问了一个类似的问题,但我仍然不明白如何获得所有已安装的应用程序的列表,然后选择一个运行。
我试过了:
Intent intent = new Intent(ACTION_MAIN);
intent.addCategory(CATEGORY_LAUNCHER);
这只显示预安装或可以运行ACTION_MAIN Intent类型的应用程序。
我也知道我可以使用PackageManager来获取所有已安装的应用程序,但我如何使用它来运行特定的应用程序呢?
本周早些时候,我问了一个类似的问题,但我仍然不明白如何获得所有已安装的应用程序的列表,然后选择一个运行。
我试过了:
Intent intent = new Intent(ACTION_MAIN);
intent.addCategory(CATEGORY_LAUNCHER);
这只显示预安装或可以运行ACTION_MAIN Intent类型的应用程序。
我也知道我可以使用PackageManager来获取所有已安装的应用程序,但我如何使用它来运行特定的应用程序呢?
下面是获取Android上安装的活动/应用程序列表的代码:
Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
List<ResolveInfo> pkgAppsList = context.getPackageManager().queryIntentActivities( mainIntent, 0);
您将在ResolveInfo中获得启动应用程序所需的所有数据。你可以在这里检查ResolveInfo javadoc。
过滤基于系统的应用程序:
private boolean isSystemPackage(ResolveInfo ri) {
return (ri.activityInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0;
}
@Jas: 我没有那个代码了,但我找到了一些接近的东西。我已经做了这个来搜索我的应用程序的“组件”,它们只是具有给定类别的活动。
private List<String> getInstalledComponentList() {
Intent componentSearchIntent = new Intent();
componentSearchIntent.addCategory(Constants.COMPONENTS_INTENT_CATEGORY);
componentSearchIntent.setAction(Constants.COMPONENTS_INTENT_ACTION_DEFAULT);
List<ResolveInfo> ril = getPackageManager().queryIntentActivities(componentSearchIntent, PackageManager.MATCH_DEFAULT_ONLY);
List<String> componentList = new ArrayList<String>();
Log.d(LOG_TAG, "Search for installed components found " + ril.size() + " matches.");
for (ResolveInfo ri : ril) {
if (ri.activityInfo != null) {
componentList.add(ri.activityInfo.packageName);// + ri.activityInfo.name);
Log.d(LOG_TAG, "Found installed: " + componentList.get(componentList.size()-1));
}
}
return componentList;
}
我已经注释了它获取活动名称的部分,但它非常简单。
下面是使用PackageManager的一种更简洁的方式
final PackageManager pm = getPackageManager();
//get a list of installed apps.
List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
for (ApplicationInfo packageInfo : packages) {
Log.d(TAG, "Installed package :" + packageInfo.packageName);
Log.d(TAG, "Source dir : " + packageInfo.sourceDir);
Log.d(TAG, "Launch Activity :" + pm.getLaunchIntentForPackage(packageInfo.packageName));
}
// the getLaunchIntentForPackage returns an intent that you can use with startActivity()
更多信息请点击这里http://qtcstation.com/2011/02/how-to-launch-another-app-from-your-app/
这里有一个很好的例子:
class PInfo {
private String appname = "";
private String pname = "";
private String versionName = "";
private int versionCode = 0;
private Drawable icon;
private void prettyPrint() {
Log.v(appname + "\t" + pname + "\t" + versionName + "\t" + versionCode);
}
}
private ArrayList<PInfo> getPackages() {
ArrayList<PInfo> apps = getInstalledApps(false); /* false = no system packages */
final int max = apps.size();
for (int i=0; i<max; i++) {
apps.get(i).prettyPrint();
}
return apps;
}
private ArrayList<PInfo> getInstalledApps(boolean getSysPackages) {
ArrayList<PInfo> res = new ArrayList<PInfo>();
List<PackageInfo> packs = getPackageManager().getInstalledPackages(0);
for(int i=0;i<packs.size();i++) {
PackageInfo p = packs.get(i);
if ((!getSysPackages) && (p.versionName == null)) {
continue ;
}
PInfo newInfo = new PInfo();
newInfo.appname = p.applicationInfo.loadLabel(getPackageManager()).toString();
newInfo.pname = p.packageName;
newInfo.versionName = p.versionName;
newInfo.versionCode = p.versionCode;
newInfo.icon = p.applicationInfo.loadIcon(getPackageManager());
res.add(newInfo);
}
return res;
}
另一种过滤系统应用程序的方法(适用于king9981的例子):
/**
* Return whether the given PackageInfo represents a system package or not.
* User-installed packages (Market or otherwise) should not be denoted as
* system packages.
*
* @param pkgInfo
* @return
*/
private boolean isSystemPackage(PackageInfo pkgInfo) {
return ((pkgInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0);
}
你可以通过下面的代码找到Android设备中已安装的应用程序列表,“packageInfo”包含已安装的应用程序信息 在设备。我们可以为安装的应用程序检索Intent packageinfo对象可以使用startactivity(intent)来启动 应用程序。这取决于你如何组织UI或Listview 或显示数据表格。基于位置的点击事件,你可以检索意图 对象和启动活动意图。
final PackageManager pm = getPackageManager();
List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
for (ApplicationInfo packageInfo : packages)
{
if(pm.getLaunchIntentForPackage(packageInfo.packageName)!= null &&
!pm.getLaunchIntentForPackage(packageInfo.packageName).equals(""))
{
System.out.println("Package Name :" + packageInfo.packageName);
System.out.println("Launch Intent For Package :" +
pm.getLaunchIntentForPackage(packageInfo.packageName));
System.out.println("Application Label :" + pm.getApplicationLabel(packageInfo));
System.out.println("Application Label :" +
pm.getApplicationIcon(packageInfo.packageName).toString());
System.out.println("i : "+i);
/*if(i==2)
{
startActivity(pm.getLaunchIntentForPackage(packageInfo.packageName));
break;
}*/
i++;
}
}
要获得所有已安装的应用程序,您可以使用包管理器
List<PackageInfo> apps = getPackageManager().getInstalledPackages(0);
要运行一个应用程序,你可以使用它的包名
Intent launchApp = getPackageManager().getLaunchIntentForPackage(“package name”)
startActivity(launchApp);
欲了解更多细节,请阅读这个博客http://codebucket.co.in/android-get-list-of-all-installed-apps/
如果在一个包中有多个启动器,上述代码就有问题。例如:在LG Optimus Facebook为LG, MySpace为LG, Twitter为LG包含在一个包的名称SNS,如果你使用上述SNS将重复。经过几个小时的研究,我得到了以下代码。看起来效果不错。
private List<String> getInstalledComponentList()
throws NameNotFoundException {
final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
List<ResolveInfo> ril = getPackageManager().queryIntentActivities(mainIntent, 0);
List<String> componentList = new ArrayList<String>();
String name = null;
for (ResolveInfo ri : ril) {
if (ri.activityInfo != null) {
Resources res = getPackageManager().getResourcesForApplication(ri.activityInfo.applicationInfo);
if (ri.activityInfo.labelRes != 0) {
name = res.getString(ri.activityInfo.labelRes);
} else {
name = ri.activityInfo.applicationInfo.loadLabel(
getPackageManager()).toString();
}
componentList.add(name);
}
}
return componentList;
}
private static boolean isThisASystemPackage(Context context, PackageInfo packageInfo ) {
try {
PackageInfo sys = context.getPackageManager().getPackageInfo("android", PackageManager.GET_SIGNATURES);
return (packageInfo != null && packageInfo.signatures != null &&
sys.signatures[0].equals(packageInfo.signatures[0]));
} catch (NameNotFoundException e) {
return false;
}
}
获取已安装的非系统应用程序列表
public static void installedApps()
{
List<PackageInfo> packList = getPackageManager().getInstalledPackages(0);
for (int i=0; i < packList.size(); i++)
{
PackageInfo packInfo = packList.get(i);
if ( (packInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0)
{
String appName = packInfo.applicationInfo.loadLabel(getPackageManager()).toString();
Log.e("App № " + Integer.toString(i), appName);
}
}
}
你可以用这个:
PackageManager pm = getApplicationContext().getPackageManager();
List<ResolveInfo> activityList = pm.queryIntentActivities(shareIntent, 0);
for (final ResolveInfo app : activityList)
{
if ((app.activityInfo.name).contains("facebook"))
{
// facebook
}
if ((app.activityInfo.name).contains("android.gm"))
{
// gmail
}
if ((app.activityInfo.name).contains("mms"))
{
// android messaging app
}
if ((app.activityInfo.name).contains("com.android.bluetooth"))
{
// android bluetooth
}
}
我需要过滤掉用户并不真正使用的系统应用程序(例如。“com.qualcomm。服务”,“更新服务”等)。最后,我添加了另一个条件来过滤应用程序列表。我只是检查了应用程序是否有“启动意图”。
因此,结果代码看起来像……
PackageManager pm = getPackageManager();
List<ApplicationInfo> apps = pm.getInstalledApplications(PackageManager.GET_GIDS);
for (ApplicationInfo app : apps) {
if(pm.getLaunchIntentForPackage(app.packageName) != null) {
// apps with launcher intent
if((app.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0) {
// updated system apps
} else if ((app.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
// system apps
} else {
// user installed apps
}
appsList.add(app);
}
}
我有另一个解决方案:
ArrayList<AppInfo> myAppsToUpdate;
// How to get the system and the user apps.
public ArrayList<AppInfo> getAppsToUpdate() {
PackageManager pm = App.getContext().getPackageManager();
List<ApplicationInfo> installedApps = pm.getInstalledApplications(0);
myAppsToUpdate = new ArrayList<AppInfo>();
for (ApplicationInfo aInfo : installedApps) {
if ((aInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
// System apps
} else {
// Users apps
AppInfo appInfo = new AppInfo();
appInfo.setAppName(aInfo.loadLabel(pm).toString());
appInfo.setPackageName(aInfo.packageName);
appInfo.setLaunchActivity(pm.getLaunchIntentForPackage(aInfo.packageName).toString());
try {
PackageInfo info = pm.getPackageInfo(aInfo.packageName, 0);
appInfo.setVersionName(info.versionName.toString());
appInfo.setVersionCode("" + info.versionCode);
myAppsToUpdate.add(appInfo);
} catch (NameNotFoundException e) {
Log.e("ERROR", "we could not get the user's apps");
}
}
}
return myAppsToUpdate;
}
干净的解决方案,过滤成功的系统应用程序
这个解决方案背后的思想是,每个系统应用程序的主活动都没有一个自定义的活动图标。这个方法给了我一个很好的结果:
public static Set<PackageInfo> getInstalledApps(Context ctx) {
final PackageManager packageManager = ctx.getPackageManager();
final List<PackageInfo> allInstalledPackages = packageManager.getInstalledPackages(PackageManager.GET_META_DATA);
final Set<PackageInfo> filteredPackages = new HashSet();
Drawable defaultActivityIcon = packageManager.getDefaultActivityIcon();
for(PackageInfo each : allInstalledPackages) {
if(ctx.getPackageName().equals(each.packageName)) {
continue; // skip own app
}
try {
// add only apps with application icon
Intent intentOfStartActivity = packageManager.getLaunchIntentForPackage(each.packageName);
if(intentOfStartActivity == null)
continue;
Drawable applicationIcon = packageManager.getActivityIcon(intentOfStartActivity);
if(applicationIcon != null && !defaultActivityIcon.equals(applicationIcon)) {
filteredPackages.add(each);
}
} catch (PackageManager.NameNotFoundException e) {
Log.i("MyTag", "Unknown package name " + each.packageName);
}
}
return filteredPackages;
}
获取所有应用程序:
PackageManager pm = getContext().getPackageManager();
List<ApplicationInfo> apps = pm.getInstalledApplications(0);
检查是否安装了应用程序,然后打开:
if((app.flags & (ApplicationInfo.FLAG_UPDATED_SYSTEM_APP | ApplicationInfo.FLAG_SYSTEM)) > 0) {
String app_package = app.packageName;
Intent launchIntent = context.getPackageManager().getLaunchIntentForPackage(app_package);
context.startActivity(launchIntent);
public static List<ApplicationInfo> getApplications(Context context) {
return context.getPackageManager().getInstalledApplications(PackageManager.GET_META_DATA);
}
自Android 11 (API级别30)以来,大多数用户安装的应用默认是不可见的。你必须静态地声明哪些应用程序和/或意图过滤器你将在你的manifest中获得信息,就像这样:
<manifest>
<queries>
<!-- Explicit apps you know in advance about: -->
<package android:name="com.example.this.app"/>
<package android:name="com.example.this.other.app"/>
<!-- Intent filter signatures that you are going to query: -->
<intent>
<action android:name="android.intent.action.SEND" />
<data android:mimeType="image/jpeg" />
</intent>
</queries>
...
</manifest>
或者要求QUERY_ALL_PACKAGES权限。
在做了上面的事情之后,这里的其他答案仍然适用。
点击这里了解更多信息:
迁移 文档 专用文档页面(有更多 信息) 官方博客 帖子
context.getPackageManager () .getInstalledApplications (PackageManager.GET_META_DATA); 应该返回所有已安装应用程序的列表,但在android 11中,它只返回系统应用程序的列表。要获得所有应用程序(系统+用户)的列表,我们需要为应用程序提供额外的权限
< uses-permission android: name = " android.permission.QUERY_ALL_PACKAGES " / >
这个答案是正确的一个列表安装的应用程序显示和搜索功能添加。
科特林
activity_all_installed_app.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".AllInstalledAppActivity">
<TextView
android:id="@+id/totalInstalledApp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/total_Installed_Apps"
android:textStyle="bold"
android:textAlignment="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/totalInstalledApp"
tools:listitem="@layout/installed_app_layout" />
</androidx.constraintlayout.widget.ConstraintLayout>
installed_app_layout.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_margin="4dp"
android:elevation="6dp"
android:background="?attr/selectableItemBackground">
<androidx.cardview.widget.CardView
android:id="@+id/cardview"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
app:cardCornerRadius="5dp"
app:cardUseCompatPadding="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/app_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:contentDescription="@string/todo"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/list_app_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="@string/app_name"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/app_icon"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/app_package"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="@string/app_package_name"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/app_icon"
app:layout_constraintTop_toBottomOf="@+id/list_app_name" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>
AppModel.kt
import android.graphics.drawable.Drawable
class AppModel(private var name:String, private var icon: Drawable, private var packages:String) {
fun getName(): String {
return name
}
fun getIcon(): Drawable {
return icon
}
fun getPackages(): String {
return packages
}
}
AppAdapter.kt
import android.app.AlertDialog
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.materialsouk.allcodeapp.R
import com.materialsouk.allcodeapp.models.AppModel
import java.util.ArrayList
import android.content.Intent
import android.net.Uri
import android.provider.Settings
import android.widget.Toast
class AppAdapter(private val context: Context, private var appModelList: ArrayList<AppModel>) :
RecyclerView.Adapter<AppAdapter.ViewHolder>() {
class ViewHolder(ItemView: View) : RecyclerView.ViewHolder(ItemView) {
val appNameTxt: TextView = itemView.findViewById(R.id.list_app_name)
val appPackageNameTxt: TextView = itemView.findViewById(R.id.app_package)
val appIcon: ImageView = itemView.findViewById(R.id.app_icon)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view: View =
LayoutInflater.from(parent.context)
.inflate(R.layout.installed_app_layout, parent, false)
return ViewHolder(view)
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder.appNameTxt.text = appModelList[position].getName()
holder.appIcon.setImageDrawable(appModelList[position].getIcon())
holder.appPackageNameTxt.text = appModelList[position].getPackages()
holder.itemView.setOnClickListener {
val dialogListTitle = arrayOf("Open App", "App Info")
val builder: AlertDialog.Builder = AlertDialog.Builder(context)
builder.setTitle("Choose Action")
.setItems(
dialogListTitle
) { _, which ->
when (which) {
0 -> {
val intent =
context.packageManager.getLaunchIntentForPackage(appModelList[position].getPackages())
if (intent != null) {
context.startActivity(intent)
}else{
Toast.makeText(context,"System app is not open for any reason.",Toast.LENGTH_LONG).show()
}
}
1 -> {
val intent = Intent()
intent.action = Settings.ACTION_APPLICATION_DETAILS_SETTINGS
intent.data =
Uri.parse("package:${appModelList[position].getPackages()}")
context.startActivity(intent)
}
}
}
builder.show()
}
}
override fun getItemCount(): Int {
return appModelList.size
}
}
这是菜单 search_menu.xml
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/app_bar_search"
android:icon="@drawable/ic_search_black_24dp"
android:title="@string/search"
app:showAsAction="ifRoom|withText"
app:actionViewClass="androidx.appcompat.widget.SearchView"/>
</menu>
AllInstalledAppActivity.kt
import android.annotation.SuppressLint
import android.app.Dialog
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.recyclerview.widget.RecyclerView
import com.materialsouk.allcodeapp.models.AppModel
import android.content.pm.PackageInfo
import android.content.pm.ApplicationInfo
import android.os.Handler
import android.os.Looper
import android.view.Menu
import android.widget.LinearLayout
import android.widget.TextView
import androidx.appcompat.widget.SearchView
import com.materialsouk.allcodeapp.adapters.AppAdapter
import java.util.*
import kotlin.collections.ArrayList
class AllInstalledAppActivity : AppCompatActivity() {
private lateinit var recyclerView: RecyclerView
private lateinit var installedAppsList: ArrayList<AppModel>
private lateinit var installedAppAdapter: AppAdapter
@SuppressLint("SetTextI18n")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_all_installed_app)
recyclerView = findViewById(R.id.recycler_view)
val loadingDialog = Dialog(this)
loadingDialog.setContentView(R.layout.loading)
loadingDialog.window!!.setLayout(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT
)
loadingDialog.setCancelable(false)
installedAppsList = ArrayList()
loadingDialog.show()
Handler(Looper.getMainLooper()).postDelayed({
getInstalledApps()
loadingDialog.dismiss()
findViewById<TextView>(R.id.totalInstalledApp).text =
"${getString(R.string.total_Installed_Apps)} ${installedAppsList.size}"
installedAppAdapter = AppAdapter(this, installedAppsList)
recyclerView.adapter = installedAppAdapter
}, 500)
}
@SuppressLint("QueryPermissionsNeeded")
private fun getInstalledApps(): ArrayList<AppModel> {
installedAppsList.clear()
val packs = packageManager.getInstalledPackages(0)
for (i in packs.indices) {
val p = packs[i]
if (!isSystemPackage(p)) {
val appName = p.applicationInfo.loadLabel(packageManager).toString()
val icon = p.applicationInfo.loadIcon(packageManager)
val packages = p.applicationInfo.packageName
installedAppsList.add(AppModel(appName, icon, packages))
}
}
installedAppsList.sortBy { it.getName().capitalized() }
return installedAppsList
}
private fun String.capitalized(): String {
return this.replaceFirstChar {
if (it.isLowerCase())
it.titlecase(Locale.getDefault())
else it.toString()
}
}
private fun isSystemPackage(pkgInfo: PackageInfo): Boolean {
return pkgInfo.applicationInfo.flags and ApplicationInfo.FLAG_SYSTEM != 0
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.search_menu, menu)
val search = menu.findItem(R.id.app_bar_search)
val searchView = search.actionView as SearchView
searchView.maxWidth = android.R.attr.width
searchView.queryHint = "Search app name or package"
searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
override fun onQueryTextSubmit(query: String?): Boolean {
return false
}
@SuppressLint("NotifyDataSetChanged")
override fun onQueryTextChange(newText: String?): Boolean {
val appModelArrayList: ArrayList<AppModel> = ArrayList()
for (i in installedAppsList) {
if (i.getName().lowercase(Locale.getDefault()).contains(
newText!!.lowercase(
Locale.getDefault()
)
)
||
i.getPackages().lowercase(Locale.getDefault()).contains(
newText.lowercase(
Locale.getDefault()
)
)
) {
appModelArrayList.add(i)
}
}
installedAppAdapter =
AppAdapter(this@AllInstalledAppActivity, appModelArrayList)
recyclerView.adapter = installedAppAdapter
installedAppAdapter.notifyDataSetChanged()
return true
}
})
return super.onCreateOptionsMenu(menu)
}
}