Example usage for android.content.pm ShortcutInfo toString

List of usage examples for android.content.pm ShortcutInfo toString

Introduction

In this page you can find the example usage for android.content.pm ShortcutInfo toString.

Prototype

@Override
public String toString() 

Source Link

Document

Return a string representation, intended for logging.

Usage

From source file:com.aliyun.homeshell.Folder.java

protected boolean createAndAddShortcut(ShortcutInfo item) {
    final BubbleTextView textView = (BubbleTextView) mInflater.inflate(R.layout.application, this, false);
    textView.applyFromShortcutInfo(item);
    //in the function "applyFromShortcutInfo", the text has been alread set by BubbleTextView.setTitle
    //textView.setText(item.title); 
    textView.setTag(item);//from  w  ww.ja va2 s . co m
    textView.updateView(item);

    textView.setOnClickListener(this);
    textView.setOnLongClickListener(this);

    // We need to check here to verify that the given item's location isn't already occupied
    // by another item.
    if (item.screen >= mContentList.size()
            || mContentList.get(item.screen).getChildAt(item.cellX, item.cellY) != null || item.cellX < 0
            || item.cellY < 0 || item.cellX >= mContentList.get(item.screen).getCountX()
            || item.cellY >= mContentList.get(item.screen).getCountY()) {
        // This shouldn't happen, log it. 
        Log.e(TAG, "Folder order not properly persisted during bind,the item is" + item.toString());
        if (!findAndSetEmptyCells(item)) {
            return false;
        }
    }

    CellLayout.LayoutParams lp = new CellLayout.LayoutParams(item.cellX, item.cellY, item.spanX, item.spanY);
    boolean insert = false;
    textView.setOnKeyListener(new FolderKeyEventListener());
    mContentList.get(item.screen).addViewToCellLayout(textView, insert ? 0 : -1, (int) item.id, lp, true);
    return true;
}