Intent setClassName - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Intent setClassName method.

This code example shows how to use the following methods:setClassName
            return collator.compare(map1.get("title"), map2.get("title")); 
        } 
    }; 
 
    protected Intent activityIntent(String pkg, String componentName) {
        Intent result = new Intent();
        result.setClassName(pkg, componentName);
        return result;
    } 
 
    protected Intent browseIntent(String path) {
        Intent result = new Intent();
        result.setClass(this, Demos.class);
        result.putExtra("com.example.android.apis.Path", path);
        return result;
    } 
 
    protected void addItem(List<Map<String, Object>> data, String name, Intent intent) {
        Map<String, Object> temp = new HashMap<String, Object>();
        temp.put("title", name);
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setClassName, setFlags
    @Override 
    public void onStart() { 
        super.onStart(); 
        // First start the activity we are instrumenting -- the contacts 
        // list. 
        Intent intent = new Intent(Intent.ACTION_MAIN);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.setClassName(getTargetContext(),
                "com.android.phone.Dialer"); 
        Activity activity = startActivitySync(intent);
 
        // This is the Activity object that was started, to do with as we want. 
        Log.i("ContactsSelectInstrumentation", "Started: " + activity);
 
        // Monitor for the expected start activity call. 
        ActivityMonitor am = addMonitor(IntentFilter.create(
            Intent.ACTION_VIEW, ContactsContract.Contacts.CONTENT_ITEM_TYPE), null, true);
 
        // We are going to enqueue a couple key events to simulate the user 
        // selecting an item in the list. 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setClassName
            return collator.compare(map1.get("title"), map2.get("title")); 
        } 
    }; 
 
    protected Intent activityIntent(String pkg, String componentName) {
        Intent result = new Intent();
        result.setClassName(pkg, componentName);
        return result;
    } 
 
    protected Intent browserIntent(String path) {
        Intent result = new Intent();
        result.setClass(this, Cocos2D.class);
        result.putExtra("org.cocos2d.tests.Path", path);
        return result;
    } 
 
    protected void addItem(List<Map<String,?>> data, String name, Intent intent) {
        Map<String, Object> temp = new HashMap<String, Object>();
        temp.put("title", name);
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setClassName
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setClassName
        } 
         
    } 
     
    private static Intent getIntentForResolveInfo(ResolveInfo info, String action) {
        Intent intent = new Intent(action);
        ActivityInfo ai = info.activityInfo;
        intent.setClassName(ai.packageName, ai.name);
        return intent;
    } 
 
    /** 
     * Starts an activity to get a shortcut. 
     * <p> 
     * For example, Gmail has an activity that lists the available labels. It 
     * returns a shortcut intent for going directly to this label. 
     */ 
    private void startShortcutActivity(ResolveInfo info) {
        Intent intent = getIntentForResolveInfo(info, Intent.ACTION_CREATE_SHORTCUT);
        startActivityForResult(intent, REQUEST_CREATE_SHORTCUT);
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:addFlags, setClassName
	{ 
		super.onStart(); 
		Looper.prepare();
 
		Log.d(TAG, "Starting package/activity: " + getTargetContext().getPackageName() + "/" + activityClassName);
		Intent intent = new Intent();
		intent.setClassName(getTargetContext(), activityClassName);
		intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		Activity activity = startActivitySync(intent);
		if (activity instanceof InstrumentedActivity)
		{ 
			((InstrumentedActivity)activity).setInstrumentation(this);
		} 
		waitForIdleSync();
	} 
 
	@Override 
	public boolean onException(Object obj, Throwable e)
	{ 
		// log, but ignore exceptions 
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setClassName, setFlags
        final String settingsActivity = imi.getSettingsActivity(); 
        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( 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setClassName
    /** Called when the activity is first created. */ 
    @Override 
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        self = this;
        Intent getRootDirectoryIntent = new Intent();
        getRootDirectoryIntent.setClassName("com.svox.pico", "com.svox.pico.CheckVoiceData");
        startActivityForResult(getRootDirectoryIntent, DATA_ROOT_DIRECTORY_REQUEST_CODE);
    } 
 
    @Override 
    public void onActivityResult(int requestCode, int resultCode, Intent data){
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == DATA_ROOT_DIRECTORY_REQUEST_CODE) {
            rootDirectory = data.getStringExtra(TextToSpeech.Engine.EXTRA_VOICE_DATA_ROOT_DIRECTORY);
            // only run the installer if there isn't another one running 
            synchronized (sInstallerStateLock) {
                if (!sIsInstalling && !sInstallationSuccess) {
                    sIsInstalling = true;
                    runInstaller(); 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:addFlags, getAction, getData, getExtras, setClassName
 
    @Override 
    protected void onHandleIntent(Intent intent) {
        ComposeMessageActivity.log("NoConfirmationSendService onHandleIntent"); 
 
        String action = intent.getAction();
        if (!TelephonyManager.ACTION_RESPOND_VIA_MESSAGE.equals(action)) {
            ComposeMessageActivity.log("NoConfirmationSendService onHandleIntent wrong action: " + 
                    action);
            return; 
        } 
        Bundle extras = intent.getExtras();
        if (extras == null) {
            ComposeMessageActivity.log("Called to send SMS but no extras"); 
            return; 
        } 
 
        String message = extras.getString(Intent.EXTRA_TEXT);
 
        Uri intentUri = intent.getData();

8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setClassName
        mWakeLock.acquire();
        
        // Use a naming convention, similar with how permissions and intents are  
        // used. Alternatives are introspection or an ugly use of statics.  
        String receiver = context.getPackageName() + ".C2DMReceiver";
        intent.setClassName(context, receiver);
         
        context.startService(intent);
 
    } 
     
     
    private void handleRegistration(final Context context, Intent intent) {
        final String registrationId = intent.getStringExtra(EXTRA_REGISTRATION_ID);
        String error = intent.getStringExtra(EXTRA_ERROR);
        String removed = intent.getStringExtra(EXTRA_UNREGISTERED);
 
        if (Log.isLoggable(TAG, Log.DEBUG)) {
            Log.d(TAG, "dmControl: registrationId = " + registrationId +
                ", error = " + error + ", removed = " + removed);
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Intent setClassName Questions & Answers:

setClassName Method Overview
Convenience for calling setComponent(ComponentName) with an explicit class name.
See Code Examples for other Android Intent Methods: