Code example for Intent

Methods: setClassNamesetFlags

0
        if (!TextUtils.isEmpty(settingsActivity)) { 
            settingsIcon.setOnClickListener(new View.OnClickListener() { 
                @Override 
                public void onClick(View arg0) { 
                    Intent intent = new Intent(Intent.ACTION_MAIN); 
                    intent.setClassName(imi.getPackageName(), settingsActivity); 
                    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK 
                            | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED 
                            | Intent.FLAG_ACTIVITY_CLEAR_TOP); 
                    startActivity(intent); 
                    closePanel(true); 
                } 
            }); 
        } else { 
            // Do not show the settings icon if the IME does not have a settings preference 
            view.findViewById(R.id.item_vertical_separator).setVisibility(View.GONE); 
            settingsIcon.setVisibility(View.GONE); 
        } 
        mRadioViewAndImiMap.put( 
                subtypeView, new Pair<InputMethodInfo, InputMethodSubtype> (imi, subtype)); 
        subtypeView.setOnClickListener(new View.OnClickListener() {