1.打开二级菜单apps界面有概率崩溃,getActivity()为空
This commit is contained in:
@@ -84,4 +84,11 @@ public class FragmentManager {
|
||||
public void destory(){
|
||||
mInstance = null;
|
||||
}
|
||||
|
||||
public String getPackageName(){
|
||||
if(mContext!=null){
|
||||
return mContext.getPackageName();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.android.nebulasdk.AppManager;
|
||||
import com.android.util.IntentUtil;
|
||||
import com.android.util.LogUtils;
|
||||
import com.ik.mboxlauncher.R;
|
||||
import com.ik.mboxlauncher.ui.FragmentManager;
|
||||
import com.ik.mboxlauncher.ui.adapter.MyAppInfoAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -72,7 +73,7 @@ public class AppsFragment extends CategoryFragment {
|
||||
List<AppBean> appBeanList = (List<AppBean>) data;
|
||||
// 创建过滤后的列表
|
||||
List<AppBean> filteredList = new ArrayList<>();
|
||||
String selfPackageName = getActivity().getPackageName();
|
||||
String selfPackageName = FragmentManager.getInstance().getPackageName();;
|
||||
|
||||
for (AppBean appBean : appBeanList) {
|
||||
// 跳过自身应用
|
||||
|
||||
Reference in New Issue
Block a user