Android开发如何获得第三方应用Widget的包名和类名

最近在做Android的平板的开发,想在桌面上预置一些第三方应用的Widget,在桌面预置Widget的方法就是要获得应用的包名和类名。

桌面预置widget的方法 在Launcher的配置文件 res/xml/default_workspace.xml中添加如下的代码:

<appwidget           launcher:packageName="com.google.android.apps.genie.geniewidget"                             //预置应用的包名           launcher:className="com.google.android.apps.genie.geniewidget.miniwidget.MiniWidgetProvider" //预置应用的Provider的类名,不是Activity的类名           launcher:screen="1"                                                                                                                                                //在第几屏 0为第一屏,           launcher:x="0"                                                                                                                                                          //x 坐标           launcher:y="0"                                                                                                                                                          //y 坐标           launcher:spanX="4"                                                                                                                                                // x 方向占几个单元格           launcher:spanY="1" />                                                                                                                                            // y 方向占几个单元格  

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wwzswp.html