shortcut+livefolder
Livefolder 组件 因为不是android刚开始支持的 导致先期开发的ContentProvider 并没有预先给予支持 而Livefolder对列名有一定限制 导致Livefolder显得有点鸡肋
所以 今天打算以shortcut形式 来使用livefolder
整个代码也比较简单 贴代码 如果有不懂得地方 诸位跟帖 再细说
源代码:
public class LivefolderTest extends ListActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
Cursor c = getContentResolver().query(People.CONTENT_URI,
null, null, null, null);
CursorAdapter adapter = new SimpleCursorAdapter(this,
android.R.layout.simple_list_item_2,c,
new String[] {People.NAME,People.NUMBER},
new int[] {android.R.id.text1,android.R.id.text2});
setListAdapter(adapter);
if (getIntent().getAction()
.equals(Intent.ACTION_CREATE_SHORTCUT)) {
createShortcut("ContactLivefolder");
}
}
public void createShortcut(String name){
Intent shortcutIntent = new Intent(Intent.ACTION_MAIN);
shortcutIntent.setClassName(this, this.getClass().getName());
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
Intent addShortcut = new Intent();
addShortcut.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
addShortcut.putExtra(Intent.EXTRA_SHORTCUT_NAME, name);
Parcelable icon = Intent.ShortcutIconResource.fromContext(
this,R.drawable.icon);
addShortcut.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, icon);
this.setResult(RESULT_OK, addShortcut);
finish();
}
emulator 运行截图:
* 系统联系人:
* shortcut 运行:
done!!!
分享到:
相关推荐
Visual+Studio+2005+Shortcut+Keys Visual+Studio+2005+Shortcut+Keys
ShortCut.exe_命令行创建快捷方式。 例: shortcut /? shortcut D:\Tencent\QQ\Bin\QQ.exe /h ctrl+shift+alt+f4 /ld c.lnk shortcut D:\Tencent\QQ\Bin\QQ.exe /d hello /ld c.lnk shortcut D:\Tencent\QQ\Bin\...
Shortcut
shortcut /? shortcut D:\Tencent\QQ\Bin\QQ.exe /h ctrl+shift+alt+f4 /ld c.lnk shortcut D:\Tencent\QQ\Bin\QQ.exe /d hello /ld c.lnk shortcut D:\Tencent\QQ\Bin\QQ.exe /s 2 /ld c.lnk shortcut D:\...
shortcut AppFile [/a Arguments] [/h HotKey] [/s ShowCmd] [/d Description][/i IconPath,IconIndex] [/l|/ld|/ll|/ls LinkFile] AppFile 你希望创建快捷方式的文件名。 /a 可选参数—用于执行文件名的额外辅助...
markup+and+send.shortcut
HTML5的<link rel="shortcut icon"标签是干什么用的
Shortcut to Si9000-能用到2038年的授权linece,对硬件工程师来说是一大助力
New Shortcut 3.shortcut
在Android中创建与删除快捷方式(shortcut)的demo
它可以给你方便的操作,可以帮你简化一些 不必要的操作。在第一功能项中,有简化的系统操作; 在第二功能项中,有你需要的快捷工具,相信对你会 有帮助的。
前言自2012年Alex Krizhevsky利用深度卷积神经网络(CNN)(AlexNet[1])取得ImageNet比赛冠军起,CNN在计算机视觉方面的应用
vs shortcut key
C#编程 WinForm窗体开发 ShortCutMenu(源码)C#编程 WinForm窗体开发 ShortCutMenu(源码)C#编程 WinForm窗体开发 ShortCutMenu(源码)C#编程 WinForm窗体开发 ShortCutMenu(源码)C#编程 WinForm窗体开发 ShortCutMenu...
DB Commander Shortcut 快捷方式
创建与删除shortcut的例子,之前上传过一个有点错误,这是改正后的.
excel shortcut keys and tips
在命令行创建快捷方式的工具SHORTCUT.EXE
Shortcut创建快捷方式及使用说明,介绍如何使用Shortcut.exe快速方便地创建快捷方式