<bdo id='83DoG'></bdo><ul id='83DoG'></ul>
    <i id='83DoG'><tr id='83DoG'><dt id='83DoG'><q id='83DoG'><span id='83DoG'><b id='83DoG'><form id='83DoG'><ins id='83DoG'></ins><ul id='83DoG'></ul><sub id='83DoG'></sub></form><legend id='83DoG'></legend><bdo id='83DoG'><pre id='83DoG'><center id='83DoG'></center></pre></bdo></b><th id='83DoG'></th></span></q></dt></tr></i><div id='83DoG'><tfoot id='83DoG'></tfoot><dl id='83DoG'><fieldset id='83DoG'></fieldset></dl></div>

    1. <tfoot id='83DoG'></tfoot>

      <small id='83DoG'></small><noframes id='83DoG'>

        <legend id='83DoG'><style id='83DoG'><dir id='83DoG'><q id='83DoG'></q></dir></style></legend>
      1. Android 更改小部件背景图片

        Android Change Widget Background Image(Android 更改小部件背景图片)
          <tbody id='g88NU'></tbody>

      2. <legend id='g88NU'><style id='g88NU'><dir id='g88NU'><q id='g88NU'></q></dir></style></legend>

            <tfoot id='g88NU'></tfoot>
              <i id='g88NU'><tr id='g88NU'><dt id='g88NU'><q id='g88NU'><span id='g88NU'><b id='g88NU'><form id='g88NU'><ins id='g88NU'></ins><ul id='g88NU'></ul><sub id='g88NU'></sub></form><legend id='g88NU'></legend><bdo id='g88NU'><pre id='g88NU'><center id='g88NU'></center></pre></bdo></b><th id='g88NU'></th></span></q></dt></tr></i><div id='g88NU'><tfoot id='g88NU'></tfoot><dl id='g88NU'><fieldset id='g88NU'></fieldset></dl></div>

              • <bdo id='g88NU'></bdo><ul id='g88NU'></ul>

                <small id='g88NU'></small><noframes id='g88NU'>

                • 本文介绍了Android 更改小部件背景图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  过去两天一直在努力更改我的小部件的背景,基于一些 if 语句(现在删除只是想从类中更改小部件背景)这里是我下面的来源.不过,我之前已经更改了图片,例如背景,但无法让它为我的小部件工作,谢谢.顺便说一下,这是我最近的尝试

                  Been struggling for the past two days to change the background of my widget, based on some if statements (removed right now just want to change the widget background from the class) here is my source below. What's up though, I've changed images before fine such as backgrounds but can not get it to work for my widget thank you. This is my most recent attempt by the way

                  //Widget Provider Class
                  public class WidgetProvider extends AppWidgetProvider {
                  
                      public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
                          final int N = appWidgetIds.length;
                  
                          for (int i=0; i<N; i++) {
                              int appWidgetId = appWidgetIds[i];
                  
                              Intent intent = new Intent(context, com.widget.WidgetDialog.class);
                              PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
                  
                              RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget);
                              views.setOnClickPendingIntent(R.id.widget, pendingIntent);
                  
                              appWidgetManager.updateAppWidget(appWidgetId, views);
                              views.setImageViewBitmap(R.id.widget, ((BitmapDrawable)context.getResources().getDrawable(R.drawable.widget_background)).getBitmap());
                  
                          }
                      }
                  }
                  
                  
                  
                  //Widget Layout XML
                  <?xml version="1.0" encoding="utf-8"?>
                  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                      android:orientation="vertical"
                      android:layout_width="fill_parent"
                      android:layout_height="fill_parent"
                      >
                      <Button android:id="@+id/widget"
                      android:background="#00000000"
                      android:layout_width="fill_parent"
                      android:layout_height="fill_parent">
                      </Button>
                  </LinearLayout>
                  

                  推荐答案

                  有人有其他想法吗?真的很想弄清楚这一点

                  Anyone got any other ideas? Really would like to get this figured out

                  最终设置了不同的布局,目前有 10 种不同的布局用于 2 个不同的小部件效率低下,但实际上工作更多的是 hack

                  ended up setting up different layouts currently have 10 different layouts for 2 different widgets inefficient but working more of a hack around really

                  这篇关于Android 更改小部件背景图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  script.sh: line 1: ./gradlew: No such file or directory on Jenkins(script.sh:第 1 行:./gradlew:Jenkins 上没有这样的文件或目录)
                  Arduino: using Serial and Software Serial with bluetooth module(Arduino:使用带有蓝牙模块的串口和软件串口)
                  Access native serial port on Android(在Android上访问本机串口)
                  Android: USB Communication Android lt;-gt; External Device(Android:USB通信Androidlt;-gt;外接设备)
                  Sending commands from a PC to an Android phone - via physical connection (USB, Serial, etc)(从 PC 向 Android 手机发送命令 - 通过物理连接(USB、串行等))
                  Android: RS232 Serial Communication with android device(Android:与安卓设备的RS232串行通信)

                      <small id='2lCnj'></small><noframes id='2lCnj'>

                      <legend id='2lCnj'><style id='2lCnj'><dir id='2lCnj'><q id='2lCnj'></q></dir></style></legend>
                        • <bdo id='2lCnj'></bdo><ul id='2lCnj'></ul>
                            <tbody id='2lCnj'></tbody>
                            <i id='2lCnj'><tr id='2lCnj'><dt id='2lCnj'><q id='2lCnj'><span id='2lCnj'><b id='2lCnj'><form id='2lCnj'><ins id='2lCnj'></ins><ul id='2lCnj'></ul><sub id='2lCnj'></sub></form><legend id='2lCnj'></legend><bdo id='2lCnj'><pre id='2lCnj'><center id='2lCnj'></center></pre></bdo></b><th id='2lCnj'></th></span></q></dt></tr></i><div id='2lCnj'><tfoot id='2lCnj'></tfoot><dl id='2lCnj'><fieldset id='2lCnj'></fieldset></dl></div>

                            <tfoot id='2lCnj'></tfoot>