Code example for Intent

Methods: putExtraputExtrassetActionsetClassName

         * Build the {@link Intent} described by this item. If this item 
         * can't create a valid {@link android.content.ComponentName}, it will return 
         * {@link Intent#ACTION_CREATE_SHORTCUT} filled with the item label. 
        Intent getIntent() {
            Intent intent = new Intent();
            if (packageName != null && className != null) {
                // Valid package and class, so fill details as normal intent 
                intent.setClassName(packageName, className);
                if (extras != null) {
            } else { 
                // No valid package or class, so treat as shortcut with label 
                intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, label);
            return intent;
        public CharSequence getLabel() {
Connect your IDE to all the code out there  Get Codota for Java