在android系统中,apk之间可以相互读取数据。但是必须具备以下条件

1.有同样的签名(*.keystoe)

2.在AndroidManifest.xml文件中配置的android:sharedUserId属性值相同

3.二个apk运行在同一个进程中.

主程序及读取的apk中AndroidManifest.xml中配置

android:sharedUserId="com.why.android"

访问资源的方法

Context mContext = this.createPackageContext("com.why.android",Context.CONTEXT_IGNORE_SECURITY);

Drawable image = mContext.getResources().getDrawable(R.drawable.icon);

Button mButton = (Button)findViewById(R.id.btn);

mButton.setBackgroundDrawable(image);

利用这原理,咱们可以为应用程序制作像QQ那样的皮肤。

更多相关文章

  1. Android应用程序四大组件
  2. Xamarin.Android使用教程之在Android和Xamarin Android(安卓)Vis
  3. 用 Eclipse 开发 Android(安卓)应用程序
  4. Android(安卓)应用程序构成
  5. Android自动化测试工具——Monkey
  6. 使用 Eclipse PhoneGap 构建 Android(安卓)应用程序入门
  7. MonoDroid架起.NET与Android之间的桥梁
  8. Android开发指南中文版(一)What is Android?
  9. androidjunit test基本知识(一)

随机推荐

  1. android之xml定义数组
  2. Android ORM 框架:GreenDao 使用详解(基础
  3. Android随VierPager滑动的导航栏
  4. Android(安卓)记事本-Demo
  5. android:ems 属性
  6. android 吸顶效果+下拉刷新 CoordinatorL
  7. Android自动测试框架Espresso
  8. 【Android 开发】:Android中EditText控件
  9. Android自学笔记之 Activity详解
  10. Android(安卓)drawText获取text宽度的三