random
جاري التحميل ...

الاحدث

التعليقات

إذا أعجبك محتوى مدونتنا نتمنى البقاء على تواصل دائم ، فقط قم بإدخال بريدك الإلكتروني للإشتراك في بريد المدونة السريع ليصلك جديد المدونة أولاً بأول ، كما يمكنك إرسال رساله بالضغط على الزر المجاور ...

random

آخر الأخبار

random

أرشيف المدونة

Banner

قائمة المدونات الإلكترونية

Recent Tabs

اتصل بنا

الاسم

بريد إلكتروني *

رسالة *


سلايدر

التسميات

About

الاحدث

مختارة

الاحدث

الاخيرة

آخر التعليقات

Recent Post

مساحة إعلانية

تابعنا على | Facebook

اخبار الانترنيت

عمل تطبيق لالغاء التطبيقات من جهازك

السلام عليكم 


اليوم في هذه التدوينة شرحنا لكم كيف عمل تطبيق لالغاء التطبيقات من هاتفك فقط 

رابط الفيديو



الكود المستعمل في الشرح

Intent startupIntent = new Intent(Intent.ACTION_MAIN); startupIntent.addCategory(Intent.CATEGORY_LAUNCHER);   final android.content.pm.PackageManager pm = getPackageManager(); List<android.content.pm.ResolveInfo> activities = pm.queryIntentActivities(startupIntent,0);   Collections.sort(activities, new Comparator<android.content.pm.ResolveInfo>() {   public int compare(android.content.pm.ResolveInfo a, android.content.pm.ResolveInfo b) {   android.content.pm.PackageManager pm = getPackageManager();   return String.CASE_INSENSITIVE_ORDER.compare(   a.loadLabel(pm).toString(),   b.loadLabel(pm).toString());   }   });   ArrayAdapter<android.content.pm.ResolveInfo> adapter = new ArrayAdapter<android.content.pm.ResolveInfo>(   this, android.R.layout.simple_list_item_1, activities) {   public View getView(int pos, View convertView, ViewGroup parent) { TextView tv = new TextView(MainActivity.this);   android.content.pm.ResolveInfo ri = getItem(pos);   tv.setText(ri.loadLabel(pm));   LinearLayout lin = new LinearLayout(MainActivity.this);ImageView iv = new ImageView(MainActivity.this);iv.setImageDrawable(ri.loadIcon(pm));lin.addView(iv);lin.addView(tv);tv.setGravity(Gravity.CENTER_VERTICAL);tv.setPadding(16,0,0,0);tv.setTextSize(16);tv.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT ));LinearLayout.LayoutParams p = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.MATCH_PARENT);p.width = 70;p.height = 70;p.bottomMargin = 4;p.topMargin = 4;iv.setLayoutParams(p);lin.setPadding(6,6,6,6);return lin;   }   };   listview1.setAdapter(adapter); listview1.setOnItemClickListener(new AdapterView.OnItemClickListener() {   @Override public void onItemClick(AdapterView adapter, View v, int position, long id) { android.content.pm.ResolveInfo resolveInfo = (android.content.pm.ResolveInfo)adapter.getItemAtPosition(position);   android.content.pm.ActivityInfo activityInfo = resolveInfo.activityInfo;   if (activityInfo == null) return;   Uri packageURI = Uri.parse("package:".concat(activityInfo.applicationInfo.packageName)); Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI); startActivity(uninstallIntent); }   });;
شكرا لكم على حسن المتابعة

aboodi_aliraqi
كاتب المقالة
كاتب ومحرر اخبار اعمل في موقع مدونة العراقي للمعلومات .

جديد قسم :

إرسال تعليق