如何获得Toast中已安装的应用程序的名称?我有已安装的应用程序列表

时间:2019-07-15 17:07:37

标签: java android installed-applications

@Override
public void onBindViewHolder(ViewHolder viewHolder, final int position) {
     final String ApplicationPackageName = stringList.get(position);
     final String ApplicationLabelName = apkInfoExtractor.GetAppName(ApplicationPackageName);
    Drawable drawable = apkInfoExtractor.getAppIconByPackageName(ApplicationPackageName);
    viewHolder.textView_App_Name.setText(ApplicationLabelName);
    viewHolder.imageView.setImageDrawable(drawable);

   }

我必须在哪里使用单击侦听器?我该怎么办?

这是MainActivity,我在其中定义了点击监听器,但是当我使用此代码时仍然出现错误。

   //This Method is defined in Adapter Class 
    @Override
public void onClickedMethod(int position) {

   Log.d(TAG,"onClickedMethod"+stringList.get(position));


}

0 个答案:

没有答案