重复启动某一款应用,并传递intent参数

        Intent intent = getPackageManager().getLaunchIntentForPackage(packageName); 
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); 
        
        switch (v.getId()) {
            case R.id.btnOpen1:
                intent.putExtra("roomid","1");
                startActivity(intent);
                break;
            case R.id.btnOpen2:
                intent.putExtra("roomid","2");
                startActivity(intent);
                break;
        }

 

posted on 2014-08-29 14:43  neil-zhao  阅读(262)  评论(0编辑  收藏  举报

导航