应用里面调用安装应用的方法
废话少说,上代码~~~~
Button button; String DOWNLOAD_VERSION_MORE_APP = File.separator + "test" + File.separator + "app" + File.separator + "QQ.apk"; String path; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); button = (Button)this.findViewById(R.id.button); button.setOnClickListener(this); path = Environment.getExternalStorageDirectory()+DOWNLOAD_VERSION_MORE_APP; System.out.println(path); } @Override public void onClick(View v) { Uri uri = Uri.fromFile(new File(path)); Intent installIntent = new Intent(Intent.ACTION_VIEW); installIntent.setDataAndType(uri, "application/vnd.android.package-archive"); startActivity(installIntent); }
不解释,很简单明了了。其实说实话,我也不会解释~~~~~~~~Y(^_^)Y
我要青春像陈孝正一样,不能有一毫米的误差!
我要青春像合伙人一样,为了自尊而战!