pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

    <bdo id='so3ko'></bdo><ul id='so3ko'></ul>
    1. <small id='so3ko'></small><noframes id='so3ko'>

    2. <legend id='so3ko'><style id='so3ko'><dir id='so3ko'><q id='so3ko'></q></dir></style></legend>
    3. <tfoot id='so3ko'></tfoot>

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

        自定義對(duì)話框上的 Admob 廣告

        Admob ad on custom Dialog(自定義對(duì)話框上的 Admob 廣告)

          <tbody id='BKP4h'></tbody>

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

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

                • <bdo id='BKP4h'></bdo><ul id='BKP4h'></ul>
                • <tfoot id='BKP4h'></tfoot>
                  本文介紹了自定義對(duì)話框上的 Admob 廣告的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我正在嘗試在應(yīng)用上實(shí)施 Admob 廣告.我想要做的是在自定義對(duì)話框上投放橫幅廣告.我已經(jīng)嘗試了所有方法,但找不到解決方案.

                  I am trying to implement Admob ads on app. What I want to do is to ad a banner ad on a custom Dialog. I have tried everything but can't find the solution.

                  我為對(duì)話框制作了一個(gè)自定義 xml.在xml上添加admob時(shí),它不會(huì)運(yùn)行.所以我嘗試以編程方式進(jìn)行.但仍然無(wú)法使其工作.

                  I have made a custom xml for the dialog. When adding admob on xml, it won't run. So I tried do it programmatically. But still can't make it work.

                  public void OnClickButton(View paramView)
                    {
                      int btn_id = paramView.getId();
                  
                         if (btn_id == R.id.hint_field)
                         {
                       //set up dialog
                             if (hint != null && hint.length()>0) {
                            final Dialog dialog = new Dialog(Activity.this);
                            dialog.requestWindowFeature(Window.FEATURE_LEFT_ICON);
                  
                            //ad loading
                            dialog.setContentView(R.layout.custom_dialog);
                            RelativeLayout layout = (RelativeLayout)findViewById(R.id.dialog_l);
                            layout.addView(ad);
                            AdRequest r = new AdRequest();
                            ad.loadAd(r);
                  
                            dialog.setTitle("Σχετικ? με την λ?ξη :");
                            dialog.setCancelable(true);
                  
                             //set up text
                            TextView text = (TextView) dialog.findViewById(R.id.hint_text);
                            text.setText(hint);
                  
                  
                  
                           //set up button
                             Button button = (Button) dialog.findViewById(R.id.Button01);
                             button.setOnClickListener(new OnClickListener() {
                             public void onClick(View v) {
                                     dialog.dismiss();
                                }
                            });
                  
                            // now that the dialog is set up, it's time to show it    
                             dialog.show();
                             dialog.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.ic_launcher);
                       }
                     }   
                  

                  單擊按鈕時(shí),我會(huì)顯示一個(gè)自定義對(duì)話框.在我的 Activity 的 OnCreate 方法中,我制作了 adView

                  On a button click I display a custom Dialog. In the OnCreate method of my Activity I have made the adView

                    AdView  ad = new AdView(this, AdSize.BANNER, "a15xxxxxxxxxxx");
                  

                  我在:layout.addView(ad); 處得到 NullPointerException;

                  I get a NullPointerException at : layout.addView(ad);

                  有什么想法嗎?

                  提前致謝!

                  推薦答案

                  問(wèn)題解決了!我必須先給自定義對(duì)話框界面充氣.下面的代碼是工作代碼!

                  Problem solved! I had to inflate the custom dialog interface first. The code below is the working code!

                   public void OnClickButton(View paramView)
                    {
                      int btn_id = paramView.getId();
                  
                         if (btn_id == R.id.hint_field)
                         {
                       //set up dialog
                             if (hint != null && hint.length()>0) {
                            final Dialog dialog = new Dialog(Activity.this, R.style.Theme_New);
                            dialog.requestWindowFeature(Window.FEATURE_LEFT_ICON);
                            dialog.setContentView(R.layout.custom_dialog);
                  
                            LayoutInflater inflater =(LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                            View main = inflater.inflate(R.layout.custom_dialog, null);
                            dialog.setContentView(main);
                            WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
                  
                            LinearLayout linear = (LinearLayout)main.findViewById(R.id.ad_layout);
                  
                                ad = new AdView(this, AdSize.IAB_MRECT, "a15xxxxxxxx");
                  
                  
                          AdRequest request = new AdRequest();
                          Set<String> keywords = new HashSet<String>();
                          keywords.add("game");
                          request.setKeywords(keywords);
                  
                            linear.addView(ad);
                            ad.loadAd(request);
                  
                            dialog.setTitle("Title :");
                            dialog.setCancelable(true);
                  
                             //set up text
                            TextView text = (TextView) dialog.findViewById(R.id.hint_text);
                            text.setText(hint);
                  
                  
                           //set up button
                             Button button = (Button) dialog.findViewById(R.id.Button01);
                             button.setOnClickListener(new OnClickListener() {
                             public void onClick(View v) {
                                     dialog.dismiss();
                                }
                            });
                  
                            // now that the dialog is set up, it's time to show it    
                             lp.width = width;
                             lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
                             dialog.show();
                             dialog.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.ic_launcher);
                             dialog.getWindow().setAttributes(lp);
                             dialog.getWindow().getAttributes().width = LayoutParams.FILL_PARENT;
                             dialog.getWindow().getAttributes().height = LayoutParams.WRAP_CONTENT;
                       }
                     }    
                  }
                  

                  這篇關(guān)于自定義對(duì)話框上的 Admob 廣告的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Get user#39;s current location using GPS(使用 GPS 獲取用戶的當(dāng)前位置)
                  IllegalArgumentException thrown by requestLocationUpdate()(requestLocationUpdate() 拋出的 IllegalArgumentException)
                  How reliable is LocationManager#39;s getLastKnownLocation and how often is it updated?(LocationManager 的 getLastKnownLocation 有多可靠,多久更新一次?)
                  How to detect Location Provider ? GPS or Network Provider(如何檢測(cè)位置提供者?GPS 或網(wǎng)絡(luò)提供商)
                  Get current location during app launch(在應(yīng)用啟動(dòng)期間獲取當(dāng)前位置)
                  locationManager.getLastKnownLocation() return null(locationManager.getLastKnownLocation() 返回 null)

                  1. <legend id='aO0Kd'><style id='aO0Kd'><dir id='aO0Kd'><q id='aO0Kd'></q></dir></style></legend>

                        <tbody id='aO0Kd'></tbody>
                        • <bdo id='aO0Kd'></bdo><ul id='aO0Kd'></ul>
                          1. <small id='aO0Kd'></small><noframes id='aO0Kd'>

                            <tfoot id='aO0Kd'></tfoot>
                          2. <i id='aO0Kd'><tr id='aO0Kd'><dt id='aO0Kd'><q id='aO0Kd'><span id='aO0Kd'><b id='aO0Kd'><form id='aO0Kd'><ins id='aO0Kd'></ins><ul id='aO0Kd'></ul><sub id='aO0Kd'></sub></form><legend id='aO0Kd'></legend><bdo id='aO0Kd'><pre id='aO0Kd'><center id='aO0Kd'></center></pre></bdo></b><th id='aO0Kd'></th></span></q></dt></tr></i><div class="ieskgu0" id='aO0Kd'><tfoot id='aO0Kd'></tfoot><dl id='aO0Kd'><fieldset id='aO0Kd'></fieldset></dl></div>

                            主站蜘蛛池模板: Honsberg流量计-Greisinger真空表-气压计-上海欧臻机电设备有限公司 | 创客匠人-让IP变现不走弯路 | 定制/定做冲锋衣厂家/公司-订做/订制冲锋衣价格/费用-北京圣达信 | 杭州用友|用友软件|用友财务软件|用友ERP系统--杭州协友软件官网 | 消电检公司,消电检价格,北京消电检报告-北京设施检测公司-亿杰(北京)消防工程有限公司 | EFM 022静电场测试仪-套帽式风量计-静电平板监测器-上海民仪电子有限公司 | 学习虾-免费的学习资料下载平台 雪花制冰机(实验室雪花制冰机)百科 | 阜阳在线-阜阳综合门户 | 超声波清洗机_细胞破碎仪_实验室超声仪器_恒温水浴-广东洁盟深那仪器 | 在线浊度仪_悬浮物污泥浓度计_超声波泥位计_污泥界面仪_泥水界面仪-无锡蓝拓仪表科技有限公司 | 青州搬家公司电话_青州搬家公司哪家好「鸿喜」青州搬家 | 自动配料系统_称重配料控制系统厂家 | 瓶盖扭矩测试仪-瓶盖扭力仪-全自动扭矩仪-济南三泉中石单品站 | POS机办理_个人pos机免费领取-银联pos机申请首页 | 耐磨焊丝,堆焊焊丝,耐磨药芯焊丝,碳化钨焊丝-北京耐默公司 | 涡街流量计_LUGB智能管道式高温防爆蒸汽温压补偿计量表-江苏凯铭仪表有限公司 | 有机肥设备生产制造厂家,BB掺混肥搅拌机、复合肥设备生产线,有机肥料全部加工设备多少钱,对辊挤压造粒机,有机肥造粒设备 -- 郑州程翔重工机械有限公司 | 武汉刮刮奖_刮刮卡印刷厂_为企业提供门票印刷_武汉合格证印刷_现金劵代金券印刷制作 - 武汉泽雅印刷有限公司 | 体视显微镜_荧光生物显微镜_显微镜报价-微仪光电生命科学显微镜有限公司 | 济南铝方通-济南铝方通价格-济南方通厂家-山东鲁方通建材有限公司 | 不锈钢复合板厂家_钛钢复合板批发_铜铝复合板供应-威海泓方金属复合材料股份有限公司 | 深圳市八百通智能技术有限公司官方网站 | 集装箱展厅-住人集装箱住宿|建筑|房屋|集装箱售楼处-山东锐嘉科技工程有限公司 | 宁波普瑞思邻苯二甲酸盐检测仪,ROHS2.0检测设备,ROHS2.0测试仪厂家 | 全自动实验室洗瓶机,移液管|培养皿|进样瓶清洗机,清洗剂-广州摩特伟希尔机械设备有限责任公司 | 精密交叉滚子轴承厂家,转盘轴承,YRT转台轴承-洛阳千协轴承 | 办公室装修_上海办公室设计装修_时尚办公新主张-后街印象 | 乐泰胶水_loctite_乐泰胶_汉高乐泰授权(中国)总代理-鑫华良供应链 | 分子精馏/精馏设备生产厂家-分子蒸馏工艺实验-新诺舜尧(天津)化工设备有限公司 | 时代北利离心机,实验室离心机,医用离心机,低速离心机DT5-2,美国SKC采样泵-上海京工实业有限公司 工业电炉,台车式电炉_厂家-淄博申华工业电炉有限公司 | 工业冷却塔维修厂家_方形不锈钢工业凉水塔维修改造方案-广东康明节能空调有限公司 | 工业胀紧套_万向节联轴器_链条-规格齐全-型号选购-非标订做-厂家批发价格-上海乙谛精密机械有限公司 | 压缩空气冷冻式干燥机_吸附式干燥机_吸干机_沪盛冷干机 | 艾默生变频器,艾默生ct,变频器,ct驱动器,广州艾默生变频器,供水专用变频器,风机变频器,电梯变频器,艾默生变频器代理-广州市盟雄贸易有限公司官方网站-艾默生变频器应用解决方案服务商 | 不锈钢法兰-碳钢法兰-法兰盘生产加工厂家-[鼎捷峰]-不锈钢法兰-碳钢法兰-法兰盘生产加工厂家-[鼎捷峰] | 合肥宠物店装修_合肥宠物美容院装修_合肥宠物医院设计装修公司-安徽盛世和居装饰 | 飞扬动力官网-广告公司管理软件,广告公司管理系统,喷绘写真条幅制作管理软件,广告公司ERP系统 | 深圳VI设计-画册设计-LOGO设计-包装设计-品牌策划公司-[智睿画册设计公司] | 冷藏车厂家|冷藏车价格|小型冷藏车|散装饲料车厂家|程力专用汽车股份有限公司销售十二分公司 | 龙门加工中心-数控龙门加工中心厂家价格-山东海特数控机床有限公司_龙门加工中心-数控龙门加工中心厂家价格-山东海特数控机床有限公司 | 釜溪印象网络 - Powered by Discuz! |