Preference setIcon - top ranked examples from Open Source projects

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

This code example shows how to use the following methods:setSummary, setTitle, Preference.setIcon
This code example shows how to use the following methods:setOnPreferenceClickListener, setSummary, Preference.setIcon, Preference.setTitle
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:setOnPreferenceClickListener, setSummary, setTitle, Preference.setIcon
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:setIcon, setIntent, setPersistent, setTitle
    * @param iIconResId 
    */ 
    @SuppressLint("NewApi") 
    private void addFilePreference(File iFile, PreferenceGroup oGroup, int iIconResId)
    { 
        Preference aPref = new Preference(_context);
        aPref.setPersistent(false);
        aPref.setTitle(iFile.getName());
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
            aPref.setIcon(iIconResId);
        // Use an intent to open with external text editor 
        Intent aIntent = new Intent();
        aIntent.setAction(android.content.Intent.ACTION_VIEW);
        aIntent.setDataAndType(Uri.fromFile(iFile), "text/plain");
        aPref.setIntent(aIntent);
         
        oGroup.addPreference(aPref);
    } 
     
   /** 
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:setOnPreferenceClickListener, setSummary, setTitle, Preference.setIcon
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:getEntries, setSummary, setIcon
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getKey, setIcon
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (resultCode != Activity.RESULT_OK) return;
        switch (requestCode) {
            case CUSTOM_USER_ICON:
                if (resultCode == Activity.RESULT_OK) {
                    String packageName = mPreference.getKey();
                    File image = new File(getActivity().getFilesDir() + File.separator
                            + "lockscreen_" + System.currentTimeMillis() + ".png");
                    String path = image.getAbsolutePath();
                    if (mImageTmp.exists()) {
                        mImageTmp.renameTo(image);
                    } 
                    image.setReadOnly();
                    modifyApplication(packageName, path);
                    Drawable icon = getDrawable(path);
                    if(icon != null) mPreference.setIcon(icon);
                } else { 
                    if (mImageTmp.exists()) {
                        mImageTmp.delete();
                    } 
                } 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setIcon, setSummary
        } 
        return result; 
    } 
 
    public void shortcutPicked(String uri, String friendlyName, Bitmap bmp, boolean isApplication) { 
          mPreference.setSummary(friendlyName); 
          Settings.System.putString(getContentResolver(), mString, (String) uri); 
          mPreference.setIcon(resize(getNavbarIconImage(mPreference))); 
    } 
    public void onActivityResult(int requestCode, int resultCode, Intent data) { 
        if (resultCode == Activity.RESULT_OK) { 
            if (requestCode == ShortcutPickerHelper.REQUEST_PICK_SHORTCUT 
                    || requestCode == ShortcutPickerHelper.REQUEST_PICK_APPLICATION 
                    || requestCode == ShortcutPickerHelper.REQUEST_CREATE_SHORTCUT) { 
                mPicker.onActivityResult(requestCode, resultCode, data); 
            } 
        } 
        super.onActivityResult(requestCode, resultCode, data); 
    } 
 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Preference setIcon Questions & Answers:

setIcon Method Overview
Sets the icon for this Preference with a Drawable.
See Code Examples for other Android Preference Methods: