最近在研究Android动态加载APK技术,偶有小得,共享一下,欢迎交流。 首先是Android 动态加载已安装的APK 被调用工程TestB: 其工程已添加了字符串、颜色和图片资源,这里不写了,读者可自行添加。
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | public class TestBActivity extends Activity{       /** Called when the activity is first created. */       @Override       public void onCreate(Bundle savedInstanceState) {           super.onCreate(savedInstanceState);           setContentView(R.layout.main);           Button button=(Button)findViewById(R.id.button1);           button.setOnClickListener(new OnClickListener() {               @Override               public void onClick(View v) {                   // TODO Auto-generated method stub                   Toast.makeText(TestBActivity.this, "this is testB", Toast.LENGTH_SHORT).show();               }           });       }   } | 
接着把TestB打包…
