Android部件没有出现在名单上开发后, [英] Android widget not showing up on the list after developed

查看:102
本文介绍了Android部件没有出现在名单上开发后,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我升级我与小部件的应用程序。这不是第一小我所做的一切。我总是遇到奇怪的问题,但小部件被shwoing就行了最后。

下面是我到目前为止,完成的:

  • 创建widget_layout.xml
  • 创建widget_info.xml

 < appwidget提供商的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    机器人:=了minWidth110dp
    机器人:=了minHeight30dp
    机器人:updatePeriodMillis =86400000
    机器人:initialLayout =@布局/ widget_layout
    机器人:resizeMode =无>
< / appwidget提供者>
 

  • 在创建WidgetProvider类
  • 添加小部件来体现<应用> 部分(因为某些原因不能粘贴在这里表现的片段,它只是没有显示,请参阅code 这里

不过,无法找到插件的小工具就行了。我调试在实际设备应用程序。我使用的库项目,但小部件文件,但在所有的项目中,我直接运行。什么能发生在这里?

解决方案

但问题是机器人:INSTALLLOCATION =preferExternal

如果应用程序安装在SD

这在某种程度上导致的问题,窗口小部件列表

I'm upgrading my app with widget. It's not the first widget I've done. I was always encountering weird issues, but the widget was shwoing up on the list eventually.

Here is what I've done so far:

  • Created widget_layout.xml
  • Created widget_info.xml

<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"  
    android:minWidth="110dp"
    android:minHeight="30dp"
    android:updatePeriodMillis="86400000"
    android:initialLayout="@layout/widget_layout"
    android:resizeMode="none">
</appwidget-provider>

  • Created WidgetProvider class
  • Added widget to manifest in the <application> section (for some reason can't paste manifest fragment here, it's just not showing, see the code here)

Still, can't find widget on the widgets list. I'm debugging the app on real device. I'm using library project, but the widget files but all in the project I run directly. What could be happening here?

解决方案

The problem was android:installLocation="preferExternal"

It somehow causes problem with widget list if the app is installed on SD

这篇关于Android部件没有出现在名单上开发后,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆