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

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

        <legend id='zDUBe'><style id='zDUBe'><dir id='zDUBe'><q id='zDUBe'></q></dir></style></legend>

      2. <tfoot id='zDUBe'></tfoot>

        Android:从主屏幕小部件拨打电话

        Android: Making a phone call from home screen widget(Android:从主屏幕小部件拨打电话)
          <i id='bNqNZ'><tr id='bNqNZ'><dt id='bNqNZ'><q id='bNqNZ'><span id='bNqNZ'><b id='bNqNZ'><form id='bNqNZ'><ins id='bNqNZ'></ins><ul id='bNqNZ'></ul><sub id='bNqNZ'></sub></form><legend id='bNqNZ'></legend><bdo id='bNqNZ'><pre id='bNqNZ'><center id='bNqNZ'></center></pre></bdo></b><th id='bNqNZ'></th></span></q></dt></tr></i><div id='bNqNZ'><tfoot id='bNqNZ'></tfoot><dl id='bNqNZ'><fieldset id='bNqNZ'></fieldset></dl></div>
            <legend id='bNqNZ'><style id='bNqNZ'><dir id='bNqNZ'><q id='bNqNZ'></q></dir></style></legend>

              <tbody id='bNqNZ'></tbody>
          • <small id='bNqNZ'></small><noframes id='bNqNZ'>

              <tfoot id='bNqNZ'></tfoot>

                  <bdo id='bNqNZ'></bdo><ul id='bNqNZ'></ul>
                  本文介绍了Android:从主屏幕小部件拨打电话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个小部件,我希望它在用户单击小部件时拨打特定号码的电话.我该怎么做呢?请帮忙.

                  I have a widget and I want it to make a phonecall to a particular number when the user clicks on the widget. How do i do this? Please help.

                  推荐答案

                  我能够使用以下代码让它工作:

                  I was able to get it working with this code:

                   @Override
                   public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
                      Log.d(LOG_TAG, "onUpdate(): ");
                      for (int appWidgetId : appWidgetIds) {
                  
                          Intent callIntent = new Intent(Intent.ACTION_CALL);
                          callIntent.setData(Uri.parse("tel:"+number));
                          PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, callIntent, 0);
                  
                          // Get the layout for the App Widget and attach an on-click listener to the button
                          RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.caller);
                          views.setOnClickPendingIntent(R.id.callButton, pendingIntent);
                  
                          // Tell the AppWidgetManager to perform an update on the current App Widget
                          appWidgetManager.updateAppWidget(appWidgetId, views);
                      }
                  }
                  

                  这篇关于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串行通信)

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

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

                        • <bdo id='qewFV'></bdo><ul id='qewFV'></ul>
                          <legend id='qewFV'><style id='qewFV'><dir id='qewFV'><q id='qewFV'></q></dir></style></legend>

                            <tfoot id='qewFV'></tfoot>
                              <tbody id='qewFV'></tbody>