Android常用适配器分析(如何制作简易Launcher)

Android 9.0 当系统内置两个Launcher时默认设置Launcher3以外的那个Launcher为默认Launcher 在9.0系统rom定制化开发中,由于产品开发需要要求系统内置两个Launcher,一个是Launcher3,一个是自己开发的Launcher,当系统启动Launcher时, 不要弹出Launcher选择列表 选择哪个Launcher要求默认选择自己开发的Launcher作为默认Launcher,关于选择Launcher列表 其实都是在ResolverActivity.java中处理的具体看下代码分析解决问题 阅读详情

Android常用适配器分析

     Android中适配器是连接后端数据和前端显示的适配器接口,是数据和UI之间重要的纽带。系统中常见的View有ListView、GridView都要用到Adapter.列表控件是扩展了android.widget.AdapterView的类,包括ListView、GridView、Spinner和Gallery。而AdapterView本身实际上扩展了android.widget.ViewGroup,这意味着ListView、GridView等都是容器控件,换句话说列表控件包含一组视图,适配器的用途是Adapter管理数据,并为其提供子视图。

下图是我在网上找到的比较全的Android适配器结构图:

 

     这里面最常用的几个布局是ArrayAdapter、SimpleAdapter、CursorAdapter以及BaseAdapter。其中BaseAdapter是一个抽象类,需要子类继承并实现其中的接口才能使用,常用于用户自定义显示比较复杂的数据。

1)ArrayAdapter<T>

     ArrayAdapter数组适配器是Android中最简单的适配器,专门用于显示列表控件。常用构造方法如下:

     public ArrayAdapter(Context context, int textViewResourceId, List<T> objects);

     public ArrayAdapter(Context context, int textViewResourceId, T[] objects);

Demo1:

public class MainActivity extends Activity {

	private ListView listView;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
//		setContentView(R.layout.activity_main);
		String[] strings = {"1", "2", "3", "4", "5"};
		ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item1, strings);
		listView = new ListView(this);
		listView.setAdapter(adapter);
		setContentView(listView);
	}
}

 注意:这里资源上针对子布局资源ID的前缀为android,意味着系统不在本地/res目录中查找,会在系统自己的目录中查找。位于SDK文件的platforms/android-version/data/res/layout目录下,我们找到simple_list_item1.xml,其实际内容如下:

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceListItemSmall"
    android:gravity="center_vertical"
    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
    android:minHeight="?android:attr/listPreferredItemHeightSmall"
/>

  这里strings可以是一个字符串数组,也可以是一个List集合。如:

private List<String> getData() {
	List<String> data = new ArratList<String>();
	data.add("one");
	data.add("two");
	data.add("three");
	data.add("four");
	data.add("three");
	return data;
}

 

   在代码中我们的Activity可以直接继承于ListActivity,ListActivity类继承与Activity类,默认绑定了一个ListView界面组件,并提供一些与列表视图、处理相关的操作。

Demo2:

    

public class MainActivity extends ListActivity {

	private ListView listView;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item1, getData());
		setListAdapter(adapter);
	}
	
	private List<String> getData() {
		List<String> data = new ArrayList<String>();
		data.add("one");
		data.add("two");
		data.add("three");
		return data;
	}

}

 

2)SimpleAdapter

     simpleAdapter的扩展性最好,可以定义各种各样的布局,添加ImageView、Button、CheckBox等。

Demo:

     simple_list.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal" >

    <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="20dp"
        android:textIsSelectable="true" >
    </TextView>

    <ImageView
        android:id="@+id/img"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="20sp" >
    </ImageView>

</LinearLayout>

     MainActivity.java

 

public class MainActivity extends ListActivity {

	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		
		String [] strings = new String[] {"title", "img"};
		int[] ids = new int[] {R.id.textView, R.id.img};
		SimpleAdapter adapter = new SimpleAdapter(this, getData(), R.layout.simple_list, strings, ids);
		setListAdapter(adapter);
	}
	
	private List<Map<String, Object>> getData() {
		List<Map<String, Object>> list = new ArrayList<Map<String,Object>>();
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("title", "Hello");
		map.put("img", R.drawable.iag);
		list.add(map);
		map = new HashMap<String, Object>();
		map.put("title", "world");
		map.put("img", R.drawable.ic_launcher);
		list.add(map);
		return list;
	}
}

 

3)CursorAdapter

    一般要以数据库为数据源的时候才会使用SimpleCursorAdapter.这个适配器也需要在ListView中使用,通过游标向列表提供数据。

Demo:

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		
		Cursor  cursor = getContentResolver().query(People.CONTENT_URI, null, null, null, null);
		startManagingCursor(cursor);
		ListAdapter adapter = new SimpleCursorAdapter(this, R.layout.simple_list, cursor, 
				new String[] {People.NAME}, new int[] {R.id.textView});
		setListAdapter(adapter);
	}

 

4)BaseAdapter

   一般用于显示复杂的列表布局,由于BaseAdapter是一个抽象类,使用该类需要自己写一个适配器继承于该类,并重新一些方法。

   如下Demo我们通过ApplicationInfoAdapter继承于BaseAdapter,实现一个简单的Launcher,通过PackageManager查询系统中Intent.ACTION_MAIN和Intent.CATEGORY_LAUNCHER的Activity并将其通过ListView的形式显示出来,然后点击某一项进入相应的Activity。

首先我们定义一个描述应用程序的类AppInfo:

public class AppInfo {
	private String appLabel;	// 应用程序标签
	private Drawable appIcon;	// 应用程序 的图像
	private Intent intent;	
 	private String pkgName;		// 应用程序所对应包名
	private Context context;
	
	public AppInfo(Context context) {
		this.context = context;
	}
	
	public String getAppLabel() {
		return appLabel;
	}
	public void setAppLabel(String appName) {
		this.appLabel = appName;
	}
	
	public Drawable getAppIcon() {
		return appIcon;
	}
	
	public void setAppIcon(Drawable appIcon) {
		this.appIcon = appIcon;
	}
	
	public Intent getIntent() {
		return intent;
	}
	
	public void setIntent(Intent intent) {
		this.intent = intent;
	}
	
	public String getPkgName() {
		return pkgName;
	}
	
	public void setPkgName(String pkgName) {
		this.pkgName = pkgName;
	}
}

      然后我们定义一个ApplicationInfoAdapter 继承于BaseAdapter,并重写其getCount(),getItem(),getItemId(),getView()等函数。

public class ApplicationInfoAdapter extends BaseAdapter {

	private static final String TAG = "ApplicationInfoAdapter";
	private List<AppInfo> mListAppInfo = null;
	LayoutInflater infater = null;
	
	public ApplicationInfoAdapter(Context context, List<AppInfo> apps) {
		// TODO Auto-generated constructor stub
		infater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		mListAppInfo = apps;
	}
	
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		Log.i(TAG, "size="+mListAppInfo.size());
		return mListAppInfo.size();
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return mListAppInfo.get(arg0);
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup viewGroup) {
		// TODO Auto-generated method stub
		Log.i(TAG, "getView at" + position);
		View view = null;
		ViewHolder holder = null;
		
		if(convertView == null || convertView.getTag()==null) {
			view = infater.inflate(R.layout.app_list, null);
			holder = new ViewHolder(view);
			view.setTag(holder);
		} else {
			view = convertView;
			holder = (ViewHolder)convertView.getTag();
		}
		
		AppInfo appInfo = (AppInfo)getItem(position);
		holder.appIcon.setImageDrawable(appInfo.getAppIcon());
		holder.tvAppLabel.setText(appInfo.getAppLabel());
		holder.tvPktName.setText(appInfo.getPkgName());
		return view;
	}
	
	class ViewHolder {
		ImageView appIcon;
		TextView tvAppLabel;
		TextView tvPktName;
		
		public ViewHolder(View view) {
			this.appIcon = (ImageView)view.findViewById(R.id.imgApp);
			this.tvAppLabel = (TextView)view.findViewById(R.id.tvAppLabel);
			this.tvPktName = (TextView)view.findViewById(R.id.tvPkgName);
		}
	}
}

    这里我们通过LAYOUT_INFLATER_SERVICE布局管理器服务动态加载app_list.xml用来显示每一个应用程序的信息

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="50dp"
    android:orientation="horizontal" >
    
    <ImageView android:id="@+id/imgApp"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent">
    </ImageView>
    
    <RelativeLayout 
        android:layout_width="fill_parent"
        android:layout_height="40dp"
        android:layout_marginLeft="10dp">
        
        <TextView android:id="@+id/tvLabel"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="AppLabel:">
        </TextView>
        
        <TextView android:id="@+id/tvAppLabel"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="3dp"
            android:text="Label"
            android:layout_toRightOf="@id/tvLabel"
            android:textColor="#ffD700">
        </TextView>
        
        <TextView android:id="@+id/tvName"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/tvLabel"
            android:text="包名">
        </TextView>

        <TextView android:id="@+id/tvPkgName"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/tvAppLabel"
            android:layout_alignLeft="@id/tvAppLabel"
            android:textColor="#ffD700">
        </TextView>
    </RelativeLayout>"
</LinearLayout>

然后我们在MainActivity中通过PackageManager查询系统中所有的ACTION_MAIN和 CATEGORY_LAUNCHER的属性的Activity,通过ApplicationInfoAdapter适配器显示到ListView上。

public class MainActivity extends Activity implements OnItemClickListener {

	private static final String LOG_TAG = "MainActivity";
	private static final int MSG_SUCCESS = 0;
	
	private ListView listView = null;
	private List<AppInfo> mListAppInfos = null;
	Handler mHandler = null;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		listView = (ListView) this.findViewById(R.id.listView);
		mListAppInfos = new ArrayList<AppInfo>();

		mHandler = new Handler() {
			public void handleMessage(android.os.Message msg) {
				switch (msg.what) {
				case MSG_SUCCESS:
					ApplicationInfoAdapter applicationInfoAdapter = new ApplicationInfoAdapter(
							MainActivity.this, mListAppInfos); 
					listView.setAdapter(applicationInfoAdapter);
					listView.setOnItemClickListener(MainActivity.this);
					break;

				default:
					break;
				}
			};
		};
		
		new Thread(new Runnable() {
			
			@Override
			public void run() {
				// TODO Auto-generated method stub
				queryAppInfo(); // 查询所有应用程序信息
				mHandler.obtainMessage(MSG_SUCCESS).sendToTarget();
			}
		}).start();
	}

	public void queryAppInfo() {
		
		PackageManager pm = this.getPackageManager();

/* 		List<ApplicationInfo> listApplications = pm.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
 		Collections.sort(listApplications, new ApplicationInfo.DisplayNameCoamparator(pm));
 		for(ApplicationInfo app : listApplications) {
 			if((app.flags & ApplicationInfo.FLAG_SYSTEM) > 0) {	// 系统程序

 			} else if( (app.flags & ApplicationInfo.FLAG_SYSTEM) <= 0) {	// 第三方程序
 				
 			} else if((app.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0) {	// 系统程序被用户更新了
 				
 			} else if((app.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0) {	// 安装在SD卡程序
 				
 			}
 		}*/
		
		
		Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
		mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
		
		// 查询获得所有ResolveInfo对象
		List<ResolveInfo> resolveInfos = pm.queryIntentActivities(mainIntent, PackageManager.MATCH_DEFAULT_ONLY);
		
		for(ResolveInfo reInfo : resolveInfos) {
			Log.e(LOG_TAG, "name:"+reInfo.activityInfo.name + "pkg:"+reInfo.activityInfo.packageName);
		}
		
		// 根据name排序
		Collections.sort(resolveInfos, new ResolveInfo.DisplayNameComparator(pm));
		
		for(ResolveInfo reInfo : resolveInfos) {
			Log.e(LOG_TAG, "name:"+reInfo.activityInfo.name + "pkg:"+reInfo.activityInfo.packageName);
		}
		
		if(mListAppInfos != null) {
			
			mListAppInfos.clear();
		
			for(ResolveInfo reInfo : resolveInfos) {
				
				String activityName = reInfo.activityInfo.name;		// 获得应用程序启动Activity的name
				String pkgName = reInfo.activityInfo.packageName;	// 获得应用程序的包名
				String appLabel = (String)reInfo.loadLabel(pm);		// 获得应用程序的Label
				Drawable icon = reInfo.loadIcon(pm);				// 获得应用程序的图标
				
				// 为应用程序的启动Activity准备Intent
				Intent launchIntent = new Intent();
				launchIntent.setComponent(new ComponentName(pkgName, activityName));
				
				// 创建一个 AppInfo 对象
				AppInfo appInfo = new AppInfo(this);
				appInfo.setAppLabel(appLabel);
				appInfo.setAppIcon(icon);
				appInfo.setPkgName(pkgName);
				appInfo.setIntent(launchIntent);
				
				mListAppInfos.add(appInfo);
				
				Log.i(LOG_TAG, "ActivityName:"+activityName+ "pkgName:"+pkgName);
			}	
		}
	}

	@Override
	public void onItemClick(AdapterView<?> adapter, View view, int arg2, long arg3) {
		// TODO Auto-generated method stub
		Intent intent = mListAppInfos.get(arg2).getIntent();
		Log.d(LOG_TAG, "intent:"+intent.toString());
		startActivity(intent);
	}

}

 

Android 11.0 当系统内置两个Launcher时默认设置Launcher3以外的那个Launcher为默认Launcher 在11.0定制化开发中,由于产品开发需要要求系统内置两个Launcher,一个是Launcher3,一个是自己开发的Launcher,当系统启动Launcher时, 不要弹出Launcher选择列表 选择哪个Launcher要求默认选择自己开发的Launcher作为默认Launcher,关于选择Launcher列表 其实都是在ResolverActivity.java中处理的具体看下代码分析解决问题,从而实现 当系统内置两个Launcher时默认设置Launcher3以外的那个Launcher为 阅读详情

相关推荐

Android 10.0 当系统内置两个Launcher时默认设置Launcher3以外的那个Launcher为默认Launcher

在10.0定制化开发中,由于产品开发需要要求系统内置两个Launcher,一个是Launcher3,一个是自己开发的Launcher,当系统启动Launcher时, 不要弹出Launcher选择列表 选择哪个Launcher要求默认选择自己开发的Launcher作为默认Launcher,关于选择Launcher列表 其实都是在ResolverActivity.java中处理的具体看下代码分析解决问题

安卓兼职framework和app工程师的博客 1389

Android Launcher3分析——开篇

从Launcher的布局入手,对Launcher的结构做简单介绍,并对Launcher中涉及到的核心类做说明,已从整体上了解Launcher

rainmonth的专栏 6722

Android Launcher分页滑动功能源码解析

Android UI框架是构建用户界面的基础,它利用视图(View)和视图组(ViewGroup)作为基本的构建块。视图是所有UI组件的基类,负责绘制和事件处理,而视图组则用于容纳和管理多个视图或视图组,形成布局结构。理解UI框架的基本概念对于开发高性能、用户体验良好的应用至关重要。ViewPager是Android开发中非常实用的组件,它允许用户在屏幕间水平滑动切换视图,非常适用于引导页、图片展示、内容预览等场景。

weixin_35045970的博客 977

Android Launcher源码

launcher主要的activity,是launcher桌面第一次启动的activity.抽象的桌面。由N个cellLayout组成,从cellLayout更高一级的层面上对事件的处理。是workspace的父类,用来桌面的左右滑屏组成workspace的view,继承自viewgroup,既是一个dragSource,又是一个dropTarget,可以将它里面的item拖出去,也可以容纳拖动过来的item。在workspace_screen里面定了一些它的view参数。辅助的文件。

2201_75617725的博客 919

Rockchip rv1126平台在gstreamer1中添加OpenCv实现视频流负片的效果

rv1126 gstreamer opencv negetive effect

Aisy_D的专栏 1471

Windows非分页缓冲池内存泄漏实战:PoolMon与RAMMap高效排查指南

本文详细介绍了Windows系统中非分页缓冲池内存泄漏的实战排查方法。当系统出现卡顿且内存占用异常增长时,通过RAMMap工具快速定位非分页缓冲池异常,并利用PoolMon监控内核内存分配标签,精准锁定泄漏源。文章提供了从确认症状、安装工具到使用findstr命令溯源驱动文件的完整五步排查流程,并总结了常见泄漏标签与解决方案,帮助用户高效解决深层系统内存问题。

weixin_28455801的博客 1036

Android M Launcher3主流程源码浅析

我见过很多技术leader在面试的时候,遇到处于迷茫期的大龄程序员,比面试官年龄都大。这些人有一些共同特征:可能工作了7、8年,还是每天重复给业务部门写代码,工作内容的重复性比较高,没有什么技术含量的工作。问到这些人的职业规划时,他们也没有太多想法。其实30岁到40岁是一个人职业发展的黄金阶段,一定要在业务范围内的扩张,技术广度和深度提升上有自己的计划,才有助于在职业发展上有持续的发展路径,而不至于停滞不前。不断奔跑,你就知道学习的意义所在!

2401_84132204的博客 757

SSD性能测试进阶:用fio的io_uring引擎榨干你的NVMe硬盘

本文深入探讨了如何利用fio的io_uring引擎对NVMe SSD进行深度性能测试。通过对比传统libaio引擎,详解了io_uring低开销、高并发的优势。文章提供了从测试矩阵设计、队列深度分析到写入放大观察和尾延迟可视化的完整进阶方法,并附有实战案例与脚本,旨在帮助用户科学压榨NVMe硬盘的极限性能,获取更真实的评估数据。

weixin_29247219的博客 337

Android Launcher全面剖析

Android Launcher全面剖析 首先来说说我为什么写这篇文章,最近公司要我负责搞Launcher,网上一查这方面的资料比较少,并且不全,研究起来相当困难,所以就写了这篇文章,希望对大家有帮助。这篇文章是相当长的,希望读者能耐心读下去,实际上也花了我很长时间来写。好了闲话少说,我们切入正题。 这篇文章我会讲以下Launcher内容: Launcher UI总体架构 Launc...

333

避开这些坑!智鼎MAP性格测试高分指南(附互联网/国企/外企答题模板)

本文深入解析智鼎MAP职业性格测试的核心逻辑与常见陷阱,提供针对互联网、国企、外企三大行业的差异化答题策略与实战模板。帮助求职者理解测试本质,避开追求完美人设、忽视程度副词等心理陷阱,塑造与目标岗位高度匹配的职业画像,从而在招聘关键环节脱颖而出。

rainy的博客 1033

【PT+Arduino+OneNET基础教程1】PacketTracer中MCU芯片编程教程(零基础入门)

PacketTracer软件内MCU芯片编程入门 零基础

ChloeMax_的博客 9479

Android Launcher源码研究(一) 基本结构

Launcher 是 Android手机开启后第一个运行的 应用程序,也叫Home,或者叫做手机桌面。 本文介绍的是4.1源码的launcher2 app. Android41\packages\apps\Launcher2 首先找到主Activity,打开AndroidManifest.xml  入口是  com.android.lau

移动生活,幸福代码 2466

SolidWorks速成教程P4-4【装配体 | 第四节】——装配体内修改模型&编辑配合方法&配合报错的解决方法

截止目前已介绍完 SolidWorks装配体的常用功能,但基础薄弱的小伙伴或许对装配体的各类功能还不够熟悉。所以这节将进一步加强装配体的学习,同时介绍新手容易犯的错误。总结出三点,一是装配体内修改模型,二是编辑配合,三是配合报错的解决方法。

嵌入式阿齐Archie 5575

android - 简易launcher - RecyclerView画廊模式

一、项目代码地址:https://github.com/lingchen1854/Simple-Launch 二、效果图: gif动图可以进git查看,csdn上传失败。 三、代码分析: 1.先上一段简单的沉浸式代码。 private void initWindow() { Window window = getWindow(); View decorView = window.getDecorView(); int ...

qq_39009576的博客 1571

(ICLR 2025)【源码讲解+复现】TIMER-XL: Long-Context Transformers for Unified Time Series Forecasting

本文提出了一种统一的多变量时序预测模型Timer-XL,其核心创新包括:1)采用自回归解码器架构,将多变量时序预测统一为next-token预测问题;2)设计TimeAttention机制,通过相对位置编码和因果掩码捕获时序位置和变量间交互;3)支持长上下文预训练以提升零样本迁移能力。模型架构包含嵌入层、时间感知注意力块和预测头,采用MSE损失进行端到端训练。实验表明该方法在多种时序任务上表现优异,特别是在长跨度预测和少样本场景下。代码实现提供了完整的模型定义、数据加载和训练流程,支持自定义配置参数。

1157

第81篇:Vibe Coding时代:LangGraph + Eval评估体系实战,解决 Agent 优化全靠感觉的问题

本文介绍了一个为LangGraph Coding Agent设计的评估体系解决方案。文章首先指出了当前AI Coding Agent开发中的常见问题:优化过程缺乏客观评估标准,导致改进效果难以量化。随后提出了一个完整的评估框架,包括评估指标(任务成功率、质量指标、安全指标、成本指标和流程指标)、项目结构设计和评估案例集。 核心内容包括: 设计了JSON格式的评估案例集,覆盖正常任务、边界任务和高风险场景 实现了模拟Agent输出的演示代码 构建了多维度评分系统,包括关键词匹配、禁用词检测和成本评估 提供了评

sundong_81的博客 56

Android Launcher 入门

Launcher(发射器),就是你经常看到主屏幕吧,其实它也是一个App,它加载着其它app的图标和名字,并通过意图打开i它们。 从本博客你可以从认识Launcher并且开发一个简单的Launcher,在你的模拟器上使用。 注意: 下面代码需要自己强烈建议手打,否则你只是复制了一个Demo。 如果你需要的只是看一下效果的话,请点击下载,转到GitHub上下载Demo,并查看。 GitH...

光临天下 1万+

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

Android获取LAUNCHER,Android 获取Launcher 启动列表

先留着有时间再看获取Launcher 启动列表即 列出所有Launcher程序 通过PackageManager 来获取[代码 步骤]1. 定义内部类 LauncherItem 用于定义Application相关属性 比如:图标 名称 以及 ComponentNameJava代码1  public class LauncherItem {23   Drawable icon;45   String...

weixin_42511217的博客 943

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

android Launcher学习总结

一、Launcher功能介绍         Launcher简称HomeScreen,是android手机加载完毕后第一个启动的应用程序,它负责除应用本身操作外的所有操作,包括有几个桌面、点击应用程序图标启动应用程序、长时间按桌面出现上下文菜单、长按桌面图标出现垃圾箱、长按桌

lixuyuan的专栏 9358

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

android Launcher基础知识

本文将www.bangchui.org网络中的《android手把手教你开发launcher》系列文章进行了整理。这篇文章对lancher的基本功能点的实现做了简单介绍,看完后会对lancher有比较深刻的认识。 1、launcher最简单实例 launcher,也就是android的桌面应用程序。下图是android2.3的launcher应用程序: 接下来我们要开发一个自己的

1万+

android 修改默认启动项launcher(一)

MTK 6.0 高通 7.1 方法一 直接在AndroidMenifest.xml中添加 android:priority=“1” 数字越大,执行等级越高 方法二 在网上找了一些其他的修改方法,均需在ActivityManagerService.java的startHomeActivityLocked添加默认启动,但是发现添加后,若系统存在多个launcher apk,则仍然会弹出launche...

Framework-coder的博客 1万+

安卓android+WebSocket实现简易QQ聊天室

本篇介绍前端是安卓的聊天室的实现方法,后端的实现看链接说明 链接说明 1.后端使用了spring boot 框架,有关spring boot 入门请戳此链接使用Intellij IDEA开发第一个spring boot项目 2.websocket后端实现细节戳此链接 界面展示 说明 有两个界面,第一个是登陆界面,我借用了我之前实现的登陆界面,并做了一些微调。需要输入ID和名字,测试的时候输入的ID...

baidu_41860619的博客 3102

安卓 linux launcher,Android之Launcher的小试心得

Launcher是Android系统的"桌面",在android2.1之前采用的是launcher,android2.2之后采用的launcher2,他们之间最大的区别是launcher2有3D效果,不过launcher2整个系统的代码的改动还是比较大的。相关阅读: Android开发:为launcher添加一个仿Mac的Dock(附源码) http://www.linuxidc.com/Lin...

weixin_29146477的博客 419

Launcher3 Widget拖拽到桌面的流程分析

一:交互图 长按Launcher进入OverView Panel界面,点击WIDGETS进入Widgets界面,拖拽widgets到Launcher桌面,显示widget到桌面,完成widget的显示操作 二:逻辑思路 1.WidgetsContainerView为显示所有Widgets的View,初始化在Launcher的onCreate方法中调用setupViews方法初始化 2...

yuemingxingxing的博客 1019
上一篇: Android关键资源详解
下一篇: Android常用列表控件
刘云
博客等级 码龄15年 99粉丝 44原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值